summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LambdaCubeWidget.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/LambdaCubeWidget.hs b/LambdaCubeWidget.hs
index 17bb361..0adb70c 100644
--- a/LambdaCubeWidget.hs
+++ b/LambdaCubeWidget.hs
@@ -70,11 +70,14 @@ lcrender lc gl = do
70lcunrealize :: LCMethods x -> IO () 70lcunrealize :: LCMethods x -> IO ()
71lcunrealize lc = do 71lcunrealize lc = do
72 m <- tryTakeMVar $ lcRealized lc 72 m <- tryTakeMVar $ lcRealized lc
73 mapM_ (\(LCRealized _ _ x) -> lcDestroyState lc x) m 73 forM_ m $ \(LCRealized storage renderer x) -> do
74 LC.disposeStorage storage
75 LC.disposeRenderer renderer
76 lcDestroyState lc x
74 77
75lcrealize :: LCMethods x -> IO () 78lcrealize :: LCMethods x -> IO ()
76lcrealize lc = do 79lcrealize lc = do
77 _ <- tryTakeMVar (lcRealized lc) 80 lcunrealize lc
78 storage <- LC.allocStorage (dynamicSchema $ lcPipeline lc) 81 storage <- LC.allocStorage (dynamicSchema $ lcPipeline lc)
79 x <- lcUploadState lc storage 82 x <- lcUploadState lc storage
80 renderer <- LC.allocRenderer (dynamicPipeline $ lcPipeline lc) 83 renderer <- LC.allocRenderer (dynamicPipeline $ lcPipeline lc)