summaryrefslogtreecommitdiffstats
path: root/WebCore/workers/WorkerThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/workers/WorkerThread.cpp')
-rw-r--r--WebCore/workers/WorkerThread.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/WebCore/workers/WorkerThread.cpp b/WebCore/workers/WorkerThread.cpp
index 52466bf..96ca89b 100644
--- a/WebCore/workers/WorkerThread.cpp
+++ b/WebCore/workers/WorkerThread.cpp
@@ -169,6 +169,8 @@ public:
{
ASSERT(context->isWorkerContext());
WorkerContext* workerContext = static_cast<WorkerContext*>(context);
+ // It's not safe to call clearScript until all the cleanup tasks posted by functions initiated by WorkerThreadShutdownStartTask have completed.
+ workerContext->clearScript();
workerContext->thread()->runLoop().terminate();
}
@@ -199,7 +201,6 @@ public:
// Event listeners would keep DOMWrapperWorld objects alive for too long. Also, they have references to JS objects,
// which become dangling once Heap is destroyed.
workerContext->removeAllEventListeners();
- workerContext->clearScript();
#if ENABLE(DATABASE)
// We wait for the database thread to clean up all its stuff so that we