Bug 901312 - Crash in mozilla::dom::ContentParent::ActorDestroy @ nsFrameMessageManager::Disconnect. r=jlebar, a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Mon, 05 Aug 2013 14:02:38 +0300
changeset 153723 b4ac01584bc80851efe9f0831c368f14f6d0b7af
parent 153722 258af60eb930ae620555002e79c2bc373e65d6b6
child 153724 6e61e289443f8328a9206ce6c122892c32b6f7be
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar, akeybl
bugs901312
milestone25.0a2
Bug 901312 - Crash in mozilla::dom::ContentParent::ActorDestroy @ nsFrameMessageManager::Disconnect. r=jlebar, a=akeybl
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -850,17 +850,20 @@ ContentParent::ShutDownProcess(bool aClo
   // returned from Get*() while in the midst of shutdown.
   MarkAsDead();
 
   // A ContentParent object might not get freed until after XPCOM shutdown has
   // shut down the cycle collector.  But by then it's too late to release any
   // CC'ed objects, so we need to null them out here, while we still can.  See
   // bug 899761.
   mMemoryReporters.Clear();
-  mMessageManager = nullptr;
+  if (mMessageManager) {
+    mMessageManager->Disconnect();
+    mMessageManager = nullptr;
+  }
 }
 
 void
 ContentParent::MarkAsDead()
 {
     if (!mAppManifestURL.IsEmpty()) {
         if (sAppContentParents) {
             sAppContentParents->Remove(mAppManifestURL);
@@ -989,17 +992,19 @@ ContentParent::ActorDestroy(ActorDestroy
 #ifdef MOZ_WIDGET_GONK
         obs->RemoveObserver(static_cast<nsIObserver*>(this), NS_VOLUME_STATE_CHANGED);
 #endif
 #ifdef ACCESSIBILITY
         obs->RemoveObserver(static_cast<nsIObserver*>(this), "a11y-init-or-shutdown");
 #endif
     }
 
-    mMessageManager->Disconnect();
+    if (ppm) {
+      ppm->Disconnect();
+    }
 
     // clear the child memory reporters
     InfallibleTArray<MemoryReport> empty;
     SetChildMemoryReporters(empty);
 
     // remove the global remote preferences observers
     Preferences::RemoveObserver(this, "");