Bug 584143 - Crashes when streams are open and a plugin instance is closed at/under nsNPAPIPluginInstance::Stop, r=bsmedberg

This commit is contained in:
Josh Aas 2010-08-09 14:38:43 -04:00
parent bd6b3373f5
commit 80c7aced07

View File

@ -182,10 +182,11 @@ NS_IMETHODIMP nsNPAPIPluginInstance::Stop()
OnPluginDestroy(&mNPP);
// clean up open streams
for (unsigned int i = 0; i < mPStreamListeners.Length(); i++) {
mPStreamListeners[i]->CleanUpStream(NPRES_USER_BREAK);
while (mPStreamListeners.Length() > 0) {
nsRefPtr<nsNPAPIPluginStreamListener> currentListener(mPStreamListeners[0]);
currentListener->CleanUpStream(NPRES_USER_BREAK);
mPStreamListeners.RemoveElement(currentListener);
}
mPStreamListeners.Clear();
if (!mPlugin)
return NS_ERROR_FAILURE;