Changeset 5815 for src/Main.hs

Show
Ignore:
Timestamp:
07/26/05 20:06:52 (3 years ago)
Author:
autrijus
svk:copy_cache_prev:
7758
Message:

* Global destruction -- DESTROYALL() on all active objects --

is now guaranteed upon program exit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Main.hs

    r5808 r5815  
    4343        writeIORef (fromJust _DoCompile) doCompile 
    4444    runWithArgs run 
     45    globalFinalize 
     46 
     47globalFinalize :: IO () 
     48globalFinalize = join $ readIORef _GlobalFinalizer 
    4549 
    4650warn :: Show a => a -> IO () 
     
    210214    f' env | Val err@(VError _ _) <- envBody env = do 
    211215        hPutStrLn stderr $ pretty err 
     216        globalFinalize 
    212217        exitFailure 
    213218    f' env = f env name 
     
    289294    end err@(VError _ _)  = do 
    290295        hPutStrLn stderr $ encodeUTF8 $ pretty err 
     296        globalFinalize 
    291297        exitFailure 
    292     end (VControl (ControlExit exit)) = exitWith exit 
     298    end (VControl (ControlExit exit)) = do 
     299        globalFinalize 
     300        exitWith exit 
    293301    end _ = return () 
    294302