[project @ 2002-04-24 13:29:01 by simonmar]
authorsimonmar <unknown>
Wed, 24 Apr 2002 13:29:01 +0000 (13:29 +0000)
committersimonmar <unknown>
Wed, 24 Apr 2002 13:29:01 +0000 (13:29 +0000)
freeStablePtr(): Only call freeStableName() if sn->ref == 0.

From: Bernard James POPE <bjpop@cs.mu.OZ.AU>

ghc/rts/Stable.c

index 5cf9c28..474134e 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stable.c,v 1.20 2002/04/09 12:56:36 simonmar Exp $
+ * $Id: Stable.c,v 1.21 2002/04/24 13:29:01 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -245,7 +245,7 @@ freeStablePtr(StgStablePtr sp)
     // If this entry has no StableName attached, then just free it
     // immediately.  This is important; it might be a while before the
     // next major GC which actually collects the entry.
-    if (sn->sn_obj == NULL) {
+    if (sn->sn_obj == NULL && sn->ref == 0) {
        freeStableName(sn);
     }
 }