mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 621260. Don't run StopPluginInstance multiple times on the same instance. Also, let StopPluginInstance do the call to instance->Stop(). r+a=josh
This commit is contained in:
parent
7adfd0617a
commit
635ece94a9
@ -2523,11 +2523,9 @@ DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aDelayedStop)
|
||||
aInstanceOwner->HidePluginWindow();
|
||||
#endif
|
||||
|
||||
inst->Stop();
|
||||
|
||||
nsCOMPtr<nsIPluginHost> pluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
|
||||
if (pluginHost)
|
||||
pluginHost->StopPluginInstance(inst);
|
||||
NS_ASSERTION(pluginHost, "Without a pluginHost, how can we have an instance to destroy?");
|
||||
pluginHost->StopPluginInstance(inst);
|
||||
|
||||
// the frame is going away along with its widget so tell the
|
||||
// window to forget its widget too
|
||||
|
@ -109,6 +109,9 @@ public:
|
||||
bool IsRunning() {
|
||||
return RUNNING == mRunning;
|
||||
}
|
||||
bool HasStartedDestroying() {
|
||||
return mRunning >= DESTROYING;
|
||||
}
|
||||
|
||||
// Indicates whether the plugin is running normally or being shut down
|
||||
bool CanFireNotifications() {
|
||||
|
@ -1218,7 +1218,7 @@ nsPluginHost::TagForPlugin(nsNPAPIPlugin* aPlugin)
|
||||
}
|
||||
}
|
||||
// a plugin should never exist without a corresponding tag
|
||||
NS_ASSERTION(PR_FALSE, "TagForPlugin has failed");
|
||||
NS_ERROR("TagForPlugin has failed");
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
@ -3216,9 +3216,11 @@ nsPluginHost::StopPluginInstance(nsIPluginInstance* aInstance)
|
||||
PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("nsPluginHost::StopPluginInstance called instance=%p\n",aInstance));
|
||||
|
||||
aInstance->Stop();
|
||||
|
||||
nsNPAPIPluginInstance* instance = static_cast<nsNPAPIPluginInstance*>(aInstance);
|
||||
if (instance->HasStartedDestroying())
|
||||
return NS_OK;
|
||||
|
||||
aInstance->Stop();
|
||||
|
||||
// if the plugin does not want to be 'cached' just remove it
|
||||
PRBool doCache = PR_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user