On 3/9/10 5:42 PM, P T Withington wrote:
I think you are missing that this is not just about LzEventable.
This check is to make sure that any event that gets sent to _any_ _subclass_ of
eventable that is in the process of being destroyed does not cause the object
to be resurrected (e.g., cause some reference to the object to get stored
somewhere by the handler). It's _very_ important to keep this check to prevent
events from creating leaks.
Right, that makes sense.
It looks like the event system now does a pretty good job of cleaning up
delegates when LzEventable subclasses are destroyed. There is some code
in LaszloLayout.lzs that attempts to track and destroy delegates that
may not be necessary anymore, e.g.:
/**
* Remove the layout from the view and unregister the delegates that
the layout
* uses.
*/
function releaseLayout ( ) {
if (this.delegates) {
for ( var i = this.delegates.length - 1; i >= 0; i -- ){
this.delegates[ i ] .unregisterAll();
}
}
...
But there's no guarantee that a subclass of layout actually uses this
mechanism. I removed this code, and it seemed like the relevant events
were removed when I deleted views controlled by the layout.
I'll do some more testing and send something out for review.
On 2010-03-09, at 18:52, Max Carlson wrote:
It looks like everything _should_ be cleaned up when an LzEventable is
destroyed, or am I missing something
--
Regards,
Max Carlson
OpenLaszlo.org