Bug 724781 - Prevent repetitive nsObjectLoadingContent StopPluginInstance calls from entering DoStopPlugin. r=joshmoz

This commit is contained in:
Jim Mathies 2012-02-29 09:04:37 -06:00
parent 5d8985e2ba
commit b1a104d755

View File

@ -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<nsPluginInstanceOwner> instOwner = mInstanceOwner;
mInstanceOwner = nsnull;
DoStopPlugin(instOwner, delayedStop);
return NS_OK;
}