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,23 +437,27 @@
         -> IO ()
 
 runMainLoopGLFW stateRef 
- = X.catch go (exitGLFW stateRef)
+ = X.catch go exit
+ where
+  exit :: X.SomeException -> IO ()
+  exit _ = exitGLFW stateRef
 
- go :: IO ()
- go = do windowIsOpen <- GLFW.windowIsOpen
-         when windowIsOpen 
-          $ do  GLFW.pollEvents
-                dirty <- fmap dirtyScreen $ readIORef stateRef
+  go   :: IO ()
+  go 
+   = do windowIsOpen <- GLFW.windowIsOpen
+        when windowIsOpen 
+         $ do  GLFW.pollEvents
+               dirty <- fmap dirtyScreen $ readIORef stateRef
 
-                when dirty
-                 $ do   s <- readIORef stateRef
-                        display s
-                        GLFW.swapBuffers
+               when dirty
+                $ do   s <- readIORef stateRef
+                       display s
+                       GLFW.swapBuffers
 
-                modifyIORef stateRef $ \s -> s { dirtyScreen = False }
-                (readIORef stateRef) >>= (\s -> idle s)
-                GLFW.sleep 0.001
-                runMainLoopGLFW stateRef
+               modifyIORef stateRef $ \s -> s { dirtyScreen = False }
+               (readIORef stateRef) >>= (\s -> idle s)
+               GLFW.sleep 0.001
+               runMainLoopGLFW stateRef
 
 
 -- Redisplay ------------------------------------------------------------------
diff --git a/gloss.cabal b/gloss.cabal
--- a/gloss.cabal
+++ b/gloss.cabal
@@ -1,5 +1,5 @@
 Name:                gloss
-Version:             1.7.6.3
+Version:             1.7.6.4
 License:             MIT
 License-file:        LICENSE
 Author:              Ben Lippmeier
