Bug 1480965 - Fix review nit. r=asuth, a=abillings
authorBlake Kaplan <mrbkap@mozilla.com>
Tue, 21 Aug 2018 13:17:50 -0400
changeset 481055 660d4e503a69aa2763639b9f0c7e14780a3d88d2
parent 481054 a6566a974207a657c2b22b77ab412e6c100afda9
child 481056 47ab510799b9a56d4d1aad68e38a733d2bc157d9
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, abillings
bugs1480965
milestone62.0
Bug 1480965 - Fix review nit. r=asuth, a=abillings
dom/serviceworkers/ServiceWorkerPrivate.cpp
--- a/dom/serviceworkers/ServiceWorkerPrivate.cpp
+++ b/dom/serviceworkers/ServiceWorkerPrivate.cpp
@@ -2049,17 +2049,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->Terminate());
-    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) {