[MLK] Possible reference count leak

VERIFIED FIXED

Status

()

Core
Layout
P3
normal
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: Patrick C. Beard, Assigned: joki (gone))

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

19 years ago
In the URL I included above you see an NS_RELEASE(regSel);, but there isn't a
release done when you break out of the loop. Is this a refcount leak?
(Reporter)

Comment 1

19 years ago
Fixing this keeps a nsJSEvenetListener object from leaking. Here's my patch:

Index: mozilla/layout/events/src/nsEventListenerManager.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/events/src/nsEventListenerManager.cpp,v
retrieving revision 1.47
diff -r1.47 nsEventListenerManager.cpp
211d210
<   nsIScriptEventListener* regSel;
224c223,225
<       if (NS_OK == ls->mListener->QueryInterface(kIScriptEventListenerIID,
(void**)&regSel)) {
---
>       nsresult rv;
>       nsCOMPtr<nsIScriptEventListener> regSel = do_QueryInterface(ls->mListener, &rv);
>       if (NS_SUCCEEDED(rv) && nsnull != regSel) {
231d231
<         NS_RELEASE(regSel);
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

19 years ago
Okay, fix in.  Thanks Patrick.

Updated

19 years ago
Status: RESOLVED → VERIFIED

Comment 3

19 years ago
Marking verified per last comments.
You need to log in before you can comment on or make changes to this bug.