Index: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp |
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp |
index ba7061c3247cf0dc2dfcb425fca63af985c43a52..2771047dc03fc86c4bdd0ef9c6db7d96b6de1af3 100644 |
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp |
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp |
@@ -145,6 +145,7 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution |
, m_stopped(false) |
{ |
ASSERT(m_outerRegistration); |
+ ThreadState::current()->registerPreFinalizer(*this); |
if (!executionContext) |
return; |
@@ -153,6 +154,17 @@ ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* execution |
m_outerRegistration->setProxy(this); |
} |
+ServiceWorkerRegistration::~ServiceWorkerRegistration() |
+{ |
+ ASSERT(!m_outerRegistration); |
+} |
+ |
+void ServiceWorkerRegistration::dispose() |
+{ |
+ // See ServiceWorker::dispose() comment why this explicit dispose() action is needed. |
+ m_outerRegistration.clear(); |
+} |
+ |
void ServiceWorkerRegistration::trace(Visitor* visitor) |
{ |
visitor->trace(m_installing); |