Bug 759788: hold a strong ref to the nsPluginInstanceOwner in DoStopPlugin to avoid crashes, r=bsmedberg, a=akeybl RELEASE_BASE_20120531
authorMats Palmgren <matspal@gmail.com>
Thu, 31 May 2012 11:03:59 -0700
changeset 92255 b8b0ed817c31e95b4dcf93e12bd7b7236a1c05d5
parent 92254 8240dfef5c67e4cd29d24073462d4c0d3df11837
child 92256 91bf09009594f7d4026379fbbef6a846c92d4934
child 92258 30de8c94684c82c6f23392bc736b1a35a84a2252
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersbsmedberg, akeybl
bugs759788
milestone13.0
Bug 759788: hold a strong ref to the nsPluginInstanceOwner in DoStopPlugin to avoid crashes, r=bsmedberg, a=akeybl
content/base/src/nsObjectLoadingContent.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -2046,16 +2046,17 @@ nsObjectLoadingContent::DoStopPlugin(nsP
   // events which can drop in underneath us and destroy the instance we are
   // about to destroy unless we prevent that with the mIsStopping flag.
   // (aForcedReentry is only true from the callback of an earlier delayed stop)
   if (mIsStopping && !aForcedReentry) {
     return;
   }
   mIsStopping = true;
 
+  nsRefPtr<nsPluginInstanceOwner> kungFuDeathGrip(aInstanceOwner);
   nsRefPtr<nsNPAPIPluginInstance> inst;
   aInstanceOwner->GetInstance(getter_AddRefs(inst));
   if (inst) {
     if (DoDelayedStop(aInstanceOwner, this, aDelayedStop)) {
       return;
     }
 
 #if defined(XP_MACOSX)