Closed Bug 295269 Opened 20 years ago Closed 19 years ago

ListenerManager leak

Categories

(Core :: DOM: Events, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: ferdinandw+bmo, Unassigned)

References

()

Details

(Keywords: memory-leak)

Opening the testcase (see url) for bug 241518 leaks (as seen in valgrind):

92 (44 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record
10 of 34
   at 0x1B905430: operator new(unsigned) (vg_replace_malloc.c:132)
   by 0x1DBEE900: NS_NewEventListenerManager(nsIEventListenerManager**)
(nsEventListenerManager.cpp:2263)
   by 0x1DBB67EC:
nsGenericElement::GetListenerManager(nsIEventListenerManager**)
(nsGenericElement.cpp:2631)
   by 0x1DBB75BC: nsDOMEventRTTearoff::AddEventListener(nsAString const&,
nsIDOMEventListener*, int, int) (nsGenericElement.cpp:718)
   by 0x1DBB1D8C: nsDOMEventRTTearoff::AddEventListener(nsAString const&,
nsIDOMEventListener*, int) (nsGenericElement.cpp:644)
   by 0x1DD7126F: nsEventReceiverSH::AddEventListenerHelper(JSContext*,
JSObject*, unsigned, long*, long*) (nsDOMClassInfo.cpp:5666)
   by 0x1BCD0414: js_Invoke (jsinterp.c:1182)
   by 0x1BCE282E: js_Interpret (jsinterp.c:3472)
   by 0x1BCD0496: js_Invoke (jsinterp.c:1202)
   by 0x1BCE282E: js_Interpret (jsinterp.c:3472)
   by 0x1BCD0496: js_Invoke (jsinterp.c:1202)
   by 0x1BCD0830: js_InternalInvoke (jsinterp.c:1279)

This may be a dup of that bug, however the leak can't be fixed by uncommenting
test.removeEventListener('click', func, false); as that testcase says.

Last lines in trace:
http://lxr.mozilla.org/seamonkey/source/content/base/src/nsGenericElement.cpp#2631
http://lxr.mozilla.org/seamonkey/source/content/events/src/nsEventListenerManager.cpp#2263
So... if I uncomment the removeEventListener() part here, I don't see any event
listener manager leaks in a current trunk build...
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.