Index: Source/core/workers/WorkerMessagingProxy.cpp |
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp |
index 228b63f2c06ab3701369fcccec7e8befc0ea8e05..e3619d6033acebe5781a0abc24435e0242e03dd5 100644 |
--- a/Source/core/workers/WorkerMessagingProxy.cpp |
+++ b/Source/core/workers/WorkerMessagingProxy.cpp |
@@ -202,7 +202,11 @@ void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<WorkerThread> workerTh |
void WorkerMessagingProxy::workerObjectDestroyed() |
{ |
- m_workerObject = nullptr; |
+ // workerObjectDestroyed() is called in InProcessWorkerBase's destructor. |
+ // Thus it should be guaranteed that a weak pointer m_workerObject has been cleared |
+ // before this method gets called. |
+ ASSERT(!m_workerObject); |
+ |
m_executionContext->postTask(FROM_HERE, createCrossThreadTask(&WorkerMessagingProxy::workerObjectDestroyedInternal, this)); |
} |