Bug 1323220 - Don't attempt to delete the child actor twice in URLClassifierParent; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 14 Dec 2016 10:39:15 -0500
changeset 449682 40d0c5bed75dee425255eca86b3c1d600154f863
parent 449599 3f6036fb9dca03914f3c6466e34d70d231487108
child 449683 9a2a507e5b17b8bbb2360196a69df59fedc4e535
push id38624
push usermozilla@kaply.com
push dateWed, 14 Dec 2016 19:19:00 +0000
reviewersbaku
bugs1323220
milestone53.0a1
Bug 1323220 - Don't attempt to delete the child actor twice in URLClassifierParent; r=baku
dom/ipc/URLClassifierParent.cpp
dom/ipc/URLClassifierParent.h
--- a/dom/ipc/URLClassifierParent.cpp
+++ b/dom/ipc/URLClassifierParent.cpp
@@ -37,16 +37,19 @@ URLClassifierParent::StartClassify(nsIPr
     Unused << Send__delete__(this, void_t());
   }
   return IPC_OK();
 }
 
 nsresult
 URLClassifierParent::OnClassifyComplete(nsresult aRv)
 {
-  Unused << Send__delete__(this, aRv);
+  if (mIPCOpen) {
+    Unused << Send__delete__(this, aRv);
+  }
   return NS_OK;
 }
 
 void
 URLClassifierParent::ActorDestroy(ActorDestroyReason aWhy)
 {
+  mIPCOpen = false;
 }
--- a/dom/ipc/URLClassifierParent.h
+++ b/dom/ipc/URLClassifierParent.h
@@ -24,14 +24,16 @@ class URLClassifierParent : public nsIUR
 
   mozilla::ipc::IPCResult StartClassify(nsIPrincipal* aPrincipal,
                                         bool aUseTrackingProtection,
                                         bool* aSuccess);
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
   ~URLClassifierParent() = default;
+
+  bool mIPCOpen = true;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_URLClassifierParent_h