Index: Source/core/workers/WorkerThread.cpp |
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp |
index b59b7f0226eb85b053dff42599223be1825152c8..8c77e0b1e9ba66d08cf645532c5f9c7f5198da69 100644 |
--- a/Source/core/workers/WorkerThread.cpp |
+++ b/Source/core/workers/WorkerThread.cpp |
@@ -137,12 +137,14 @@ void WorkerThread::workerThread() |
ThreadIdentifier threadID = m_threadID; |
-#if !ENABLE_OILPAN |
- ASSERT(m_workerGlobalScope->hasOneRef()); |
-#endif |
- |
// The below assignment will destroy the context, which will in turn notify messaging proxy. |
// We cannot let any objects survive past thread exit, because no other thread will run GC or otherwise destroy them. |
+ // If Oilpan is enabled, we detach of the context/global scope, with the final heap cleanup below sweeping it out. |
+#if ENABLE(OILPAN) |
+ m_workerGlobalScope->dispose(); |
+#else |
+ ASSERT(m_workerGlobalScope->hasOneRef()); |
+#endif |
m_workerGlobalScope = nullptr; |
ThreadState::detach(); |