From a3394e523e694523b591e2e7d66a48192e74bdc3 Mon Sep 17 00:00:00 2001 From: Kosyrev Serge <_deepfire@feelingofgreen.ru> Date: Mon, 29 May 2017 00:45:58 +0300 Subject: GL.Input: fix a couple of space leaks in addObject/removeObject Repro: https://github.com/deepfire/holotype/commit/db5402b52142d43cd5914ef2f3d4c0313a3aac0b - issue: make lcs SCENARIO=ManMeshObjOrig - issue fix: make lcs SCENARIO=ManMeshObj --- src/LambdaCube/GL/Input.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/LambdaCube') diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs index 011671f..30125d9 100644 --- a/src/LambdaCube/GL/Input.hs +++ b/src/LambdaCube/GL/Input.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-} +{-# LANGUAGE BangPatterns, FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-} module LambdaCube.GL.Input where import Control.Applicative @@ -117,7 +117,7 @@ addObject input slotName prim indices attribs uniformNames = do , objCommands = cmdsRef } - modifyIORef (slotVector input ! slotIdx) $ \(GLSlot objs _ _) -> GLSlot (IM.insert index obj objs) V.empty Generate + modifyIORef' (slotVector input ! slotIdx) $ \(GLSlot objs _ _) -> GLSlot (IM.insert index obj objs) V.empty Generate -- generate GLObjectCommands for the new object {- @@ -144,7 +144,7 @@ addObject input slotName prim indices attribs uniformNames = do return obj removeObject :: GLStorage -> Object -> IO () -removeObject p obj = modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs _ _) -> GLSlot (IM.delete (objId obj) objs) V.empty Generate +removeObject p obj = modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot !objs _ _) -> GLSlot (IM.delete (objId obj) objs) V.empty Generate enableObject :: Object -> Bool -> IO () enableObject obj b = writeIORef (objEnabled obj) b -- cgit v1.2.3