Event handler is being detached without being released

M

Moshe Katz

Hi,

I'm attaching various event handlers to various DOM elements, in order
to track browser behavior.

The problem I'm facing is that one of the handlers is being detached
from the DOM element without being released.
Problem is even more serious in cases I'm replacing the original
handler with my handler in order to perform mine first and then call
the original, once my handler is being removed, the original is not
called anymore.

Does anybody have any idea?

Thanks,
Moshe.
 
M

Michael Winter

The problem I'm facing is that one of the handlers is being detached
from the DOM element without being released.
Problem is even more serious in cases I'm replacing the original
handler with my handler in order to perform mine first and then call
the original, once my handler is being removed, the original is not
called anymore.

Does anybody have any idea?

First, describe what you mean by "released". I don't see what removing an
event listener has to do with releasing anything.

Mike
 
M

Moshe Katz

Michael Winter said:
First, describe what you mean by "released". I don't see what removing an
event listener has to do with releasing anything.

I'm using C++ and COM and not JavaScript.
The event handler therefore is a COM object that I'm placing as a
property of the DOM element.

The problem is that although the handler is being removed from the
element (I'm checking it when getting the bubbled-up event), its
refcount is not decremented as I would expect (I traced the
AddRef/Release methods).

Usually when such handler is being released (as a COM object that one
of its references
doesn't hold it anymore) I know to rearrange my handlers again.


Thanks,
Moshe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top