[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: onload event listeners attached to NodeImpls which fail to be
From:       Andrew Coles <andrew_coles () yahoo ! co ! uk>
Date:       2005-06-03 12:47:10
Message-ID: 200506031347.10376.andrew_coles () yahoo ! co ! uk
[Download RAW message or body]

On Friday 27 May 2005 13:04, Andrew Coles wrote:
> OK, in Webcore the line to delete a NodeImpl if it hasn't been attached to
> something has been removed, and the attribute map is cleared instead.
>
> Would not deleting the nodeimpl create a memory leak?  The diff is below.

I've done a little testing with valgrind: not deleting the nodeimpl to which 
the event is attached _does_ create a memory leak; does webcore have some way 
of dealing with this or does it leak?

Personally I think memory leaking to avoid this crash is an inelegant way of 
dealing with the problem.  From what I can see, the presence of event 
listeners does not affect whether the nodeimpl can be attached anywhere. So, 
one approach would be to split parseAttribute up into two parts: 
parseEventAttribute to set event handlers, and parseNonEventAttribute one to 
deal with everything else.  Initially, only call parseNonEventAttribute; 
should the node then be successfully attached, call parseEventAttribute to 
register listeners and so on.

Andrew
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic