Fix for when the browser calls "Destroy" twice for some XPCOM plugins bug 104038 r=av sr=attinasi

git-svn-id: svn://10.0.0.236/trunk@107529 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterlubczynski%netscape.com
2001-11-07 01:12:14 +00:00
parent 8a19b66a7c
commit da662eeea7

View File

@@ -405,7 +405,15 @@ nsActivePlugin::~nsActivePlugin()
rv = peer->GetOwner(*getter_AddRefs(owner));
owner->SetInstance(nsnull);
}
mInstance->Destroy();
// now check for cached plugins because they haven't had nsIPluginInstance::Destroy()
// called yet. For non-cached plugins, nsIPluginInstance::Destroy() is called
// in either nsObjectFrame::Destroy() or nsActivePluginList::stopRunning()
PRBool doCache = PR_TRUE;
mInstance->GetValue(nsPluginInstanceVariable_DoCacheBool, (void *) &doCache);
if (doCache)
mInstance->Destroy();
NS_RELEASE(mInstance);
NS_RELEASE(mPeer);
}
@@ -601,6 +609,7 @@ void nsActivePluginList::stopRunning()
else {
p->mInstance->SetWindow(nsnull);
p->mInstance->Stop();
p->mInstance->Destroy();
}
doCallSetWindowAfterDestroy = PR_FALSE;
p->setStopped(PR_TRUE);