I think I know the reason now: When the apply-Method is called on my Tree
object the first time, I don't get that error, the Tree isn't disposed. When
that method is called the second time it's called on a new Tree instance
that had been created shortly before. Again, a new snProxy object is created
and the "update"-event listener is added to it. However, the old Tree
instance still exists together with its snProxy object that still fires the
"update"-event although the Tree it is contained in is already disposed
(since it is not referenced anymore).
Since there are multiple snProxys now the event handler function is called
multiple times but only in the last call the event handler function refers
to the current non-disposed Tree (I didn't recognize that at first sight
because the application broke on an error and stopped running and only let
the first "update"-event listener process its code). The snProxy object
itself isn't disposed because it is referenced in an event listener of an
object that still exists.
So if I add
if (!this.isDisposed()) {
this.debug(this);
// do something
}
to the event handler the program runs. But I think this solution is not
elegant. The event handler is still called by objects that shouldn't exist
anymore. I think I'll try to add a method that removes all the event
listeners that could cause such problems.
2010/9/22 Christian Hagendorn <[email protected]>
> Am 22.09.2010 16:04, schrieb Marius Austerschulte:
> > Great! That seems to be the reason! this.isDisposed() and
> > this.__rootNode.isDisposed() are both true.
> > But then why is it disposed? I still have a reference that points to
> > that object.
> Hi Marius,
>
> I don't know what exactly is the reason in your case, maybe your
> application does it. You can try to debug it buy adding a this.trace()
> in the destruct function [1] in the class which has the appear method.
> The stack trace should show how dispose/destroy the qooxdoo object.
>
> Keep in mind that dispose and destroy has a differer meaning here. It
> just means that a qooxdoo object is cleaned up for garbage collection. A
> qooxdoo dispose/destroy removes for example all DOM references so that
> the garbage collector can remove the object from memory if no reference
> exist in your application.
>
> Cheers,
> Chris
>
> [1]
>
> http://manual.qooxdoo.org/1.2.x/pages/core/oo_feature_summary.html#destructor
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel