diff --git a/Changelog.txt b/Changelog.txt
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,3 +1,9 @@
+Tue Aug  5 15:45:35 PDT 2014  paul@thev.net
+  * Bump version to 0.5.2.2
+
+Tue Aug  5 15:45:31 PDT 2014  paul@thev.net
+  * Add NOINLINE to stablize top-level IORefs
+
 Tue Aug  5 11:44:50 PDT 2014  paul@thev.net
   * Bump version to 0.5.2.1
 
diff --git a/GLFW.cabal b/GLFW.cabal
--- a/GLFW.cabal
+++ b/GLFW.cabal
@@ -1,5 +1,5 @@
 name:          GLFW
-version:       0.5.2.1
+version:       0.5.2.2
 homepage:      http://haskell.org/haskellwiki/GLFW
 maintainer:    Paul H. Liu <paul@thev.net>
 cabal-version: >= 1.12
diff --git a/Graphics/UI/GLFW.hs b/Graphics/UI/GLFW.hs
--- a/Graphics/UI/GLFW.hs
+++ b/Graphics/UI/GLFW.hs
@@ -1332,13 +1332,21 @@
 glfwMousewheelfun    :: IORef (Maybe (FunPtr GLFWmousewheelfun))
 glfwKeyfun           :: IORef (Maybe (FunPtr GLFWkeyfun))
 glfwCharfun          :: IORef (Maybe (FunPtr GLFWcharfun))
+{-# NOINLINE glfwWindowsizefun    #-}
 glfwWindowsizefun    = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwWindowclosefun   #-}
 glfwWindowclosefun   = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwWindowrefreshfun #-}
 glfwWindowrefreshfun = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwMousebuttonfun   #-}
 glfwMousebuttonfun   = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwMouseposfun      #-}
 glfwMouseposfun      = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwMousewheelfun    #-}
 glfwMousewheelfun    = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwKeyfun           #-}
 glfwKeyfun           = unsafePerformIO (newIORef Nothing)
+{-# NOINLINE glfwCharfun          #-}
 glfwCharfun          = unsafePerformIO (newIORef Nothing)
 
 foreign import ccall unsafe "wrapper" glfwWrapFun2 :: (CInt -> CInt -> IO ()) -> IO (FunPtr (CInt -> CInt -> IO ()))
