зеркало из https://github.com/mozilla/gecko-dev.git
Bug 766886 - Cleanup plugin streams earlier to avoid shutdown leak. r=bsmedberg
This commit is contained in:
Родитель
b5ffc75108
Коммит
6860ce9323
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче