Index: Source/web/ServiceWorkerGlobalScopeProxy.cpp |
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
index f48c98e9006739b2aba2ffb624b8e25aa95eb5e7..22363c329e752e69045d518602631a406d35650d 100644 |
--- a/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp |
@@ -39,6 +39,7 @@ |
#include "core/events/MessageEvent.h" |
#include "core/inspector/ConsoleMessage.h" |
#include "core/workers/WorkerGlobalScope.h" |
+#include "core/workers/WorkerThread.h" |
#include "modules/background_sync/SyncEvent.h" |
#include "modules/background_sync/SyncRegistration.h" |
#include "modules/fetch/Headers.h" |
@@ -225,8 +226,9 @@ void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed() |
void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope() |
{ |
+ v8::HandleScope handleScope(m_workerGlobalScope->thread()->isolate()); |
+ m_client.willDestroyWorkerContext(m_workerGlobalScope->script()->context()); |
m_workerGlobalScope = nullptr; |
- m_client.willDestroyWorkerContext(); |
} |
void ServiceWorkerGlobalScopeProxy::workerThreadTerminated() |