diff options
-rw-r--r-- | LambdaCubeWidget.hs | 7 |
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 | |||
70 | lcunrealize :: LCMethods x -> IO () | 70 | lcunrealize :: LCMethods x -> IO () |
71 | lcunrealize lc = do | 71 | lcunrealize 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 | ||
75 | lcrealize :: LCMethods x -> IO () | 78 | lcrealize :: LCMethods x -> IO () |
76 | lcrealize lc = do | 79 | lcrealize 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) |