
12 Apr
2002
12 Apr
'02
5:33 a.m.
On Fri, Apr 12, 2002 at 12:37:17AM +0200, Wolfgang Thaller wrote:
Calle Lejdfors wrote:
exitWith ExitSuccess
That however causes a:
TestGLUT: fatal error: GLUT_CBWindow_d7Tf: uncaught exception
This is because GHC implements exit using an exception that is caught outside the main program - GHC's implementation of exitWith just doesn't work with callbacks.
As a workaround I suggest importing shutdownHaskellAndExit from the run-time system:
foreign import shutdownHaskellAndExit :: Int -> IO ()
This seems to do the trick. Thanks alot! /Calle