From b1a104d75591e841a7197d2449757918559dbbcd Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Wed, 29 Feb 2012 09:04:37 -0600 Subject: [PATCH] Bug 724781 - Prevent repetitive nsObjectLoadingContent StopPluginInstance calls from entering DoStopPlugin. r=joshmoz --- content/base/src/nsObjectLoadingContent.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 576d3f4a487..77ee34e91c9 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -2133,10 +2133,13 @@ nsObjectLoadingContent::StopPluginInstance() } #endif - DoStopPlugin(mInstanceOwner, delayedStop); - + // DoStopPlugin can process events and there may be pending InDocCheckEvent + // events which can drop in underneath us and destroy the instance we are + // about to destroy. Make sure this doesn't happen via this temp ref ptr and + // the !mInstanceOwner check above. + nsRefPtr instOwner = mInstanceOwner; mInstanceOwner = nsnull; - + DoStopPlugin(instOwner, delayedStop); return NS_OK; }