From 7367cd559803479c321065138ec17a0113fb95ec Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 21 May 1999 14:28:32 +0000 Subject: [PATCH] [project @ 1999-05-21 14:28:32 by sof] Don't perform repeated shutdowns --- ghc/rts/RtsStartup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index 49ccb42..fd9d671 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $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 * @@ -35,10 +35,11 @@ */ struct RTS_FLAGS RtsFlags; +static int rts_has_started_up = 0; + void startupHaskell(int argc, char *argv[]) { - static int rts_has_started_up = 0; int i; /* To avoid repeated initialisations of the RTS */ @@ -139,6 +140,9 @@ startupHaskell(int argc, char *argv[]) void shutdownHaskell(void) { + if (!rts_has_started_up) + return; + /* Finalize any remaining weak pointers */ finalizeWeakPointersNow(); @@ -177,6 +181,8 @@ shutdownHaskell(void) The fflush avoids this sad possibility. */ fflush(stdout); + + rts_has_started_up=0; } -- 1.7.10.4