Commit 7367cd55 authored by sof's avatar sof
Browse files

[project @ 1999-05-21 14:28:32 by sof]

Don't perform repeated shutdowns
parent c037793b
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: RtsStartup.c,v 1.12 1999/05/10 08:23:56 sof Exp $ * $Id: RtsStartup.c,v 1.13 1999/05/21 14:28:32 sof Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -35,10 +35,11 @@ ...@@ -35,10 +35,11 @@
*/ */
struct RTS_FLAGS RtsFlags; struct RTS_FLAGS RtsFlags;
static int rts_has_started_up = 0;
void void
startupHaskell(int argc, char *argv[]) startupHaskell(int argc, char *argv[])
{ {
static int rts_has_started_up = 0;
int i; int i;
/* To avoid repeated initialisations of the RTS */ /* To avoid repeated initialisations of the RTS */
...@@ -139,6 +140,9 @@ startupHaskell(int argc, char *argv[]) ...@@ -139,6 +140,9 @@ startupHaskell(int argc, char *argv[])
void void
shutdownHaskell(void) shutdownHaskell(void)
{ {
if (!rts_has_started_up)
return;
/* Finalize any remaining weak pointers */ /* Finalize any remaining weak pointers */
finalizeWeakPointersNow(); finalizeWeakPointersNow();
...@@ -177,6 +181,8 @@ shutdownHaskell(void) ...@@ -177,6 +181,8 @@ shutdownHaskell(void)
The fflush avoids this sad possibility. The fflush avoids this sad possibility.
*/ */
fflush(stdout); fflush(stdout);
rts_has_started_up=0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment