Bug 1155241 - Check mInstanceOwner for nullptr in nsObjectLoadingContent::PluginDestroyed. r=smaug, a=lmandel
authorAaron Klotz <aklotz@mozilla.com>
Wed, 15 Apr 2015 16:24:28 -0600
changeset 265702 678bcebcb8a59341840486bcd10e72c86491cb95
parent 265701 4131212a78cedf48e0c5522556962e71a37f4abc
child 265703 4abcc0869ba05c075ec5c9da20dbe028c23e4dce
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lmandel
bugs1155241
milestone39.0a2
Bug 1155241 - Check mInstanceOwner for nullptr in nsObjectLoadingContent::PluginDestroyed. r=smaug, a=lmandel
dom/base/nsObjectLoadingContent.cpp
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -2715,18 +2715,20 @@ nsObjectLoadingContent::GetPrintFrame(ns
 
 NS_IMETHODIMP
 nsObjectLoadingContent::PluginDestroyed()
 {
   // Called when our plugin is destroyed from under us, usually when reloading
   // plugins in plugin host. Invalidate instance owner / prototype but otherwise
   // don't take any action.
   TeardownProtoChain();
-  mInstanceOwner->Destroy();
-  mInstanceOwner = nullptr;
+  if (mInstanceOwner) {
+    mInstanceOwner->Destroy();
+    mInstanceOwner = nullptr;
+  }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsObjectLoadingContent::PluginCrashed(nsIPluginTag* aPluginTag,
                                       const nsAString& pluginDumpID,
                                       const nsAString& browserDumpID,
                                       bool submittedCrashReport)