Bug 766886 - Cleanup plugin streams earlier to avoid shutdown leak. r=bsmedberg

This commit is contained in:
John Schoenick 2012-11-08 18:29:37 -08:00
Родитель b5ffc75108
Коммит 6860ce9323
1 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -208,14 +208,17 @@ nsNPAPIPluginStreamListener::CleanUpStream(NPReason reason)
// Seekable streams have an extra addref when they are created which must
// be matched here.
if (NP_SEEK == mStreamType)
if (NP_SEEK == mStreamType && mStreamStarted)
NS_RELEASE_THIS();
if (mStreamListenerPeer) {
mStreamListenerPeer->CancelRequests(NS_BINDING_ABORTED);
mStreamListenerPeer = nullptr;
}
if (!mInst || !mInst->CanFireNotifications())
return rv;
mStreamListenerPeer = nullptr;
PluginDestructionGuard guard(mInst);
nsNPAPIPlugin* plugin = mInst->GetPlugin();
@ -280,7 +283,7 @@ nsNPAPIPluginStreamListener::CallURLNotify(NPReason reason)
nsresult
nsNPAPIPluginStreamListener::OnStartBinding(nsPluginStreamListenerPeer* streamPeer)
{
if (!mInst || !mInst->CanFireNotifications())
if (!mInst || !mInst->CanFireNotifications() || mStreamCleanedUp)
return NS_ERROR_FAILURE;
PluginDestructionGuard guard(mInst);