Attempt to fix some plugin leaks. Bug 302737, r+sr=jst

This commit is contained in:
bzbarsky%mit.edu 2005-09-14 17:17:25 +00:00
parent 7dc2cda258
commit 1b2b138576
2 changed files with 3 additions and 7 deletions

View File

@ -923,9 +923,10 @@ MakeNew4xStreamInternal(NPP npp, const char *relativeURL, const char *target,
NS_ASSERTION(pm, "failed to get plugin manager");
if (!pm) return NPERR_GENERIC_ERROR;
nsIPluginStreamListener* listener = nsnull;
nsCOMPtr<nsIPluginStreamListener> listener;
if (target == nsnull)
((ns4xPluginInstance*)inst)->NewNotifyStream(&listener, notifyData,
((ns4xPluginInstance*)inst)->NewNotifyStream(getter_AddRefs(listener),
notifyData,
bDoNotify, relativeURL);
switch (type) {

View File

@ -231,11 +231,6 @@ void ns4xPluginStreamListener::CallURLNotify(NPReason reason)
("NPP URLNotify called: this=%p, npp=%p, notify=%p, reason=%d, url=%s\n",
this, npp, mNotifyData, reason, mNotifyURL));
}
// Let's not leak this stream listener. Release the reference to the stream listener
// added for the notify callback in NewNotifyStream.
// Note: This may destroy us if we are not being destroyed already.
NS_RELEASE_THIS();
}