From e65f8a086f4f3c0d1a5291856460b7083553888c Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 20 Jul 2006 03:18:30 +0000 Subject: [PATCH] Attempt to fix some plugin leaks. Bug 302737, r+sr=jst, a=schrep git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@203220 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/plugin/base/src/ns4xPlugin.cpp | 5 +++-- mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp index e53848f0121..c629c248f47 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp @@ -1080,9 +1080,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 listener; if (target == nsnull) - ((ns4xPluginInstance*)inst)->NewNotifyStream(&listener, notifyData, + ((ns4xPluginInstance*)inst)->NewNotifyStream(getter_AddRefs(listener), + notifyData, bDoNotify, relativeURL); switch (type) { diff --git a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp index daf7215ee78..067b7542e6f 100644 --- a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp @@ -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(); }