Bug 759788 - Keep the plugin instance owner alive for the duration of DoStopPlugin so that everything gets cleaned up correctly, r=bsmedberg
authorMats Palmgren <matspal@gmail.com>
Thu, 31 May 2012 08:44:10 -0400
changeset 97623 0aa7fc75cad51c23e659d75181313b0611fd7574
parent 97622 f4981b5e1f7a1b7e951c7013a2bc30fb72c0e01c
child 97625 183aed68ea36b7b243c181eda70a83603dc2bb4e
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs759788
milestone15.0a1
Bug 759788 - Keep the plugin instance owner alive for the duration of DoStopPlugin so that everything gets cleaned up correctly, r=bsmedberg
content/base/src/nsObjectLoadingContent.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -2182,16 +2182,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)