Event handler is being detached without being released

Discussion in 'Javascript' started by Moshe Katz, Apr 28, 2004.

  1. Moshe Katz

    Moshe Katz Guest

    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.
    Moshe Katz, Apr 28, 2004
    #1
    1. Advertising

  2. On 28 Apr 2004 05:12:42 -0700, Moshe Katz <> wrote:

    > 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

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
    Michael Winter, May 1, 2004
    #2
    1. Advertising

  3. Moshe Katz

    Moshe Katz Guest

    Michael Winter <> wrote in message news:<>...
    > On 28 Apr 2004 05:12:42 -0700, Moshe Katz <> wrote:
    >
    > > 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.


    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.

    >
    > Mike



    Thanks,
    Moshe.
    Moshe Katz, May 2, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Laird
    Replies:
    1
    Views:
    2,151
    Alberto Morales
    Sep 5, 2003
  2. The Dark Seraph

    Detached interpreter threads

    The Dark Seraph, May 27, 2004, in forum: Python
    Replies:
    0
    Views:
    297
    The Dark Seraph
    May 27, 2004
  3. Robin Becker

    detached subprocess

    Robin Becker, May 23, 2005, in forum: Python
    Replies:
    0
    Views:
    378
    Robin Becker
    May 23, 2005
  4. Replies:
    1
    Views:
    682
    Damien
    Feb 22, 2007
  5. Replies:
    2
    Views:
    941
Loading...

Share This Page