summaryrefslogtreecommitdiff
path: root/GLWidget.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-04-21 15:20:46 -0400
committerJoe Crayne <joe@jerkface.net>2019-04-21 15:20:46 -0400
commitfea9323ada05c1264b9ddca2e12f10560e7f171b (patch)
tree31f35d37e8ce78e53a9bd408c7732fc0a5a9ceec /GLWidget.hs
parent08ebb9b93559b757b095d25f02a51894a3098f66 (diff)
Forward port ManagedPtr usage.
Diffstat (limited to 'GLWidget.hs')
-rw-r--r--GLWidget.hs6
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
14import GI.Gdk.Objects (GLContext(..),windowCreateGlContext) 14import GI.Gdk.Objects (GLContext(..),windowCreateGlContext)
15import qualified GI.Gtk as Gtk 15import qualified GI.Gtk as Gtk
16 ;import GI.Gtk as Gtk hiding (main) 16 ;import GI.Gtk as Gtk hiding (main)
17import Data.GI.Base.ManagedPtr (newManagedPtr)
17import System.IO 18import System.IO
18 19
19data WidgetMethods st = WidgetMethods 20data 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
77oopsG :: GError -> IO () 77oopsG :: GError -> IO ()
78oopsG e = do 78oopsG e = do