Bug 1480965 - Fix review nit. r=asuth
authorBlake Kaplan <mrbkap@mozilla.com>
Wed, 22 Aug 2018 15:34:16 -0400
changeset 432887 a7caa2f69479cee185e4a7caa9a9516ed1159298
parent 432886 4bf7cca192e7657ed0bdaa598b2a9ddb30ac5472
child 432888 2f5f240834b06ed1ca71635b10d5b2a60a422f8d
push id106914
push userbugmail@asutherland.org
push dateWed, 22 Aug 2018 19:35:16 +0000
treeherdermozilla-inbound@a7caa2f69479 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1480965
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480965 - Fix review nit. r=asuth
dom/serviceworkers/ServiceWorkerPrivate.cpp
--- a/dom/serviceworkers/ServiceWorkerPrivate.cpp
+++ b/dom/serviceworkers/ServiceWorkerPrivate.cpp
@@ -1936,17 +1936,17 @@ ServiceWorkerPrivate::TerminateWorker()
     if (DOMPrefs::ServiceWorkersTestingEnabled()) {
       nsCOMPtr<nsIObserverService> os = services::GetObserverService();
       if (os) {
         os->NotifyObservers(nullptr, "service-worker-shutdown", nullptr);
       }
     }
 
     Unused << NS_WARN_IF(!mWorkerPrivate->Cancel());
-    mWorkerPrivate = nullptr;
+    RefPtr<WorkerPrivate> workerPrivate(mWorkerPrivate.forget());
     mSupportsArray.Clear();
 
     // Any pending events are never going to fire on this worker.  Cancel
     // them so that intercepted channels can be reset and other resources
     // cleaned up.
     nsTArray<RefPtr<WorkerRunnable>> pendingEvents;
     mPendingFunctionalEvents.SwapElements(pendingEvents);
     for (uint32_t i = 0; i < pendingEvents.Length(); ++i) {