From: simonmar Date: Wed, 25 Feb 2004 16:18:00 +0000 (+0000) Subject: [project @ 2004-02-25 16:18:00 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~58 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e15f63f358d021b7901562ad787fbd1fb00c9a82;p=ghc-hetmet.git [project @ 2004-02-25 16:18:00 by simonmar] ShutdownIOManager: don't free the IOManagerState, because the worker threads haven't necessarily died yet and might reference it again. Apparently fixes a strange bug: I have a Haskell program which on Windows causes the shell to exit after I run it. I don't know what the real cause of this is, but this is a clear bug and fixing it stops the shell from exiting. MERGE TO STABLE --- diff --git a/ghc/rts/win32/IOManager.c b/ghc/rts/win32/IOManager.c index b8b7942..ca5fd4d 100644 --- a/ghc/rts/win32/IOManager.c +++ b/ghc/rts/win32/IOManager.c @@ -363,9 +363,12 @@ AddProcRequest ( void* proc, return depositWorkItem(reqID, wItem); } -void ShutdownIOManager() +void ShutdownIOManager ( void ) { SetEvent(ioMan->hExitEvent); - free(ioMan); - ioMan = NULL; + // ToDo: we can't free this now, because the worker thread(s) + // haven't necessarily finished with it yet. Perhaps it should + // have a reference count or something. + // free(ioMan); + // ioMan = NULL; }