Index: Source/heap/ThreadState.cpp |
diff --git a/Source/heap/ThreadState.cpp b/Source/heap/ThreadState.cpp |
index 233a979afe7ea6e39a9d325529717307e42d90a9..58735a1bf4dd93a325bc49d13003e306ae05f926 100644 |
--- a/Source/heap/ThreadState.cpp |
+++ b/Source/heap/ThreadState.cpp |
@@ -296,13 +296,7 @@ void ThreadState::cleanup() |
// After this GC we expect heap to be empty because |
// preCleanup tasks should have cleared all persistent |
// handles that were externally owned. |
- // FIXME: oilpan: we should perform a single GC and everything |
- // should die. Unfortunately it is not the case for all objects |
- // because the hierarchy was not completely moved to the heap and |
- // some heap allocated objects own objects that contain persistents |
- // pointing to other heap allocated objects. |
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
+ Heap::collectAllGarbage(ThreadState::NoHeapPointersOnStack); |
// Verify that all heaps are empty now. |
for (int i = 0; i < NumberOfHeaps; i++) |
@@ -317,6 +311,8 @@ void ThreadState::cleanup() |
void ThreadState::detach() |
{ |
ThreadState* state = current(); |
+ state->cleanup(); |
+ |
// Enter safe point before trying to acquire threadAttachMutex |
// to avoid dead lock if another thread is preparing for GC, has acquired |
// threadAttachMutex and waiting for other threads to pause or reach a |