another fix for -hb: we appear to be freeing the hash table and arena twice
[ghc-hetmet.git] / 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);
+    }
 }
 
 /* --------------------------------------------------------------------------
 }
 
 /* --------------------------------------------------------------------------