another fix for -hb: we appear to be freeing the hash table and arena twice
authorSimon Marlow <simonmar@microsoft.com>
Wed, 13 Jun 2007 11:15:52 +0000 (11:15 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 13 Jun 2007 11:15:52 +0000 (11:15 +0000)
rts/ProfHeap.c

index ed5dc36..f1a3b05 100644 (file)
@@ -343,8 +343,12 @@ initEra(Census *census)
 STATIC_INLINE void
 freeEra(Census *census)
 {
 STATIC_INLINE void
 freeEra(Census *census)
 {
-    arenaFree(census->arena);
-    freeHashTable(census->hash, NULL);
+    if (RtsFlags.ProfFlags.bioSelector != NULL)
+        // when bioSelector==NULL, these are freed in heapCensus()
+    {
+        arenaFree(census->arena);
+        freeHashTable(census->hash, NULL);
+    }
 }
 
 /* --------------------------------------------------------------------------
 }
 
 /* --------------------------------------------------------------------------