summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2017-05-28 18:51:24 -0600
committerGitHub <noreply@github.com>2017-05-28 18:51:24 -0600
commit211a9753d1494b92e73eafd60c0a45c8420fda2d (patch)
treef0f866f517bd2187994f241af971dff9acea31ef /src/LambdaCube/GL
parent46fedd26db1f5d3966b594bd9aa9ec92fb9d37ff (diff)
parenta3394e523e694523b591e2e7d66a48192e74bdc3 (diff)
Merge pull request #12 from deepfire/fix-space-leak-11
Fix space leak, as per #11
Diffstat (limited to 'src/LambdaCube/GL')
-rw-r--r--src/LambdaCube/GL/Input.hs6
-rw-r--r--src/LambdaCube/GL/Mesh.hs2
2 files changed, 4 insertions, 4 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
diff --git a/src/LambdaCube/GL/Mesh.hs b/src/LambdaCube/GL/Mesh.hs
index 1b1b823..2c9dcda 100644
--- a/src/LambdaCube/GL/Mesh.hs
+++ b/src/LambdaCube/GL/Mesh.hs
@@ -7,7 +7,7 @@ module LambdaCube.GL.Mesh (
7 Mesh(..), 7 Mesh(..),
8 MeshPrimitive(..), 8 MeshPrimitive(..),
9 MeshAttribute(..), 9 MeshAttribute(..),
10 GPUMesh, 10 GPUMesh(..), GPUData(..),
11 meshData 11 meshData
12) where 12) where
13 13