diff options
author | Joe Crayne <joe@jerkface.net> | 2019-04-21 15:20:46 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-04-21 15:20:46 -0400 |
commit | fea9323ada05c1264b9ddca2e12f10560e7f171b (patch) | |
tree | 31f35d37e8ce78e53a9bd408c7732fc0a5a9ceec /GLWidget.hs | |
parent | 08ebb9b93559b757b095d25f02a51894a3098f66 (diff) |
Forward port ManagedPtr usage.
Diffstat (limited to 'GLWidget.hs')
-rw-r--r-- | GLWidget.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/GLWidget.hs b/GLWidget.hs index 681083f..19ef129 100644 --- a/GLWidget.hs +++ b/GLWidget.hs | |||
@@ -14,6 +14,7 @@ import Foreign.Ptr | |||
14 | import GI.Gdk.Objects (GLContext(..),windowCreateGlContext) | 14 | import GI.Gdk.Objects (GLContext(..),windowCreateGlContext) |
15 | import qualified GI.Gtk as Gtk | 15 | import qualified GI.Gtk as Gtk |
16 | ;import GI.Gtk as Gtk hiding (main) | 16 | ;import GI.Gtk as Gtk hiding (main) |
17 | import Data.GI.Base.ManagedPtr (newManagedPtr) | ||
17 | import System.IO | 18 | import System.IO |
18 | 19 | ||
19 | data WidgetMethods st = WidgetMethods | 20 | data WidgetMethods st = WidgetMethods |
@@ -70,9 +71,8 @@ nullableContext mk = mk >>= maybe mknull return | |||
70 | where | 71 | where |
71 | mknull = do | 72 | mknull = do |
72 | oops "createContext: GLArea has no window." | 73 | oops "createContext: GLArea has no window." |
73 | fp <- newForeignPtr_ nullPtr | 74 | mptr <- newManagedPtr nullPtr (return ()) |
74 | disown <- newIORef Nothing | 75 | return $ GLContext mptr |
75 | return $ GLContext $ ManagedPtr fp disown | ||
76 | 76 | ||
77 | oopsG :: GError -> IO () | 77 | oopsG :: GError -> IO () |
78 | oopsG e = do | 78 | oopsG e = do |