summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKosyrev Serge <_deepfire@feelingofgreen.ru>2017-05-29 00:45:58 +0300
committerKosyrev Serge <_deepfire@feelingofgreen.ru>2017-05-29 00:45:58 +0300
commita3394e523e694523b591e2e7d66a48192e74bdc3 (patch)
treef0f866f517bd2187994f241af971dff9acea31ef
parentaf8f3e20b4c641f13ab01027ce2622730697c0f5 (diff)
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
-rw-r--r--src/LambdaCube/GL/Input.hs6
1 files changed, 3 insertions, 3 deletions
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 @@
1{-# LANGUAGE FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-} 1{-# LANGUAGE BangPatterns, FlexibleContexts, TypeSynonymInstances, FlexibleInstances #-}
2module LambdaCube.GL.Input where 2module LambdaCube.GL.Input where
3 3
4import Control.Applicative 4import Control.Applicative
@@ -117,7 +117,7 @@ addObject input slotName prim indices attribs uniformNames = do
117 , objCommands = cmdsRef 117 , objCommands = cmdsRef
118 } 118 }
119 119
120 modifyIORef (slotVector input ! slotIdx) $ \(GLSlot objs _ _) -> GLSlot (IM.insert index obj objs) V.empty Generate 120 modifyIORef' (slotVector input ! slotIdx) $ \(GLSlot objs _ _) -> GLSlot (IM.insert index obj objs) V.empty Generate
121 121
122 -- generate GLObjectCommands for the new object 122 -- generate GLObjectCommands for the new object
123 {- 123 {-
@@ -144,7 +144,7 @@ addObject input slotName prim indices attribs uniformNames = do
144 return obj 144 return obj
145 145
146removeObject :: GLStorage -> Object -> IO () 146removeObject :: GLStorage -> Object -> IO ()
147removeObject p obj = modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot objs _ _) -> GLSlot (IM.delete (objId obj) objs) V.empty Generate 147removeObject p obj = modifyIORef (slotVector p ! objSlot obj) $ \(GLSlot !objs _ _) -> GLSlot (IM.delete (objId obj) objs) V.empty Generate
148 148
149enableObject :: Object -> Bool -> IO () 149enableObject :: Object -> Bool -> IO ()
150enableObject obj b = writeIORef (objEnabled obj) b 150enableObject obj b = writeIORef (objEnabled obj) b