diff --git a/Graphics/Gloss/Internals/Interface/Backend/GLFW.hs b/Graphics/Gloss/Internals/Interface/Backend/GLFW.hs
--- a/Graphics/Gloss/Internals/Interface/Backend/GLFW.hs
+++ b/Graphics/Gloss/Internals/Interface/Backend/GLFW.hs
@@ -437,15 +437,7 @@
         -> IO ()
 
 runMainLoopGLFW stateRef 
- = X.catch go recover
- where
- recover :: X.SomeException -> IO ()
- recover _ = do
-#ifdef linux_HOST_OS
--- See [Note: FreeGlut] for why we need this.
-        GLUT.exit
-#endif
-        return ()
+ = X.catch go (exitGLFW stateRef)
 
  go :: IO ()
  go = do windowIsOpen <- GLFW.windowIsOpen
diff --git a/gloss.cabal b/gloss.cabal
--- a/gloss.cabal
+++ b/gloss.cabal
@@ -1,5 +1,5 @@
 Name:                gloss
-Version:             1.7.6.1
+Version:             1.7.6.2
 License:             MIT
 License-file:        LICENSE
 Author:              Ben Lippmeier
@@ -36,7 +36,7 @@
 Library
   Build-Depends: 
         base       == 4.*,
-        ghc-prim   == 0.3.*,
+        ghc-prim   >= 0.2 && < 0.4,
         containers >= 0.3 && < 0.6,
         bytestring >= 0.9 && < 0.11,
         OpenGL     == 2.5.*,
