| Index: Source/core/workers/Worker.cpp
|
| diff --git a/Source/core/workers/Worker.cpp b/Source/core/workers/Worker.cpp
|
| index f6056006676c2247d2535440e36e07b9036a83de..fb5bfc796db25238bf50dd77e5cb12c6e215a701 100644
|
| --- a/Source/core/workers/Worker.cpp
|
| +++ b/Source/core/workers/Worker.cpp
|
| @@ -82,9 +82,10 @@ PassRefPtrWillBeRawPtr<Worker> Worker::create(ExecutionContext* context, const S
|
| Worker::~Worker()
|
| {
|
| ASSERT(isMainThread());
|
| + if (!m_contextProxy)
|
| + return;
|
| ASSERT(executionContext()); // The context is protected by worker context proxy, so it cannot be destroyed while a Worker exists.
|
| - if (m_contextProxy)
|
| - m_contextProxy->workerObjectDestroyed();
|
| + m_contextProxy->workerObjectDestroyed();
|
| }
|
|
|
| const AtomicString& Worker::interfaceName() const
|
| @@ -114,7 +115,7 @@ void Worker::stop()
|
|
|
| bool Worker::hasPendingActivity() const
|
| {
|
| - return m_contextProxy->hasPendingActivity() || ActiveDOMObject::hasPendingActivity();
|
| + return (m_contextProxy && m_contextProxy->hasPendingActivity()) || ActiveDOMObject::hasPendingActivity();
|
| }
|
|
|
| void Worker::didReceiveResponse(unsigned long identifier, const ResourceResponse&)
|
|
|