I've implemented onUnload to call removeHandler for the HandlerRegistration
instance returned from SimpleEventBus.addHandler and it works perfectly.
Thanks for pointing me in the right direction.

By the way, Thomas, I was also wrong about my Composite's orphaned
EventHandler not throwing an exception. It obviously (head slap lol) does.

 Thanks so much.

Jeff

On Tue, Dec 21, 2010 at 4:07 AM, Thomas Broyer <[email protected]> wrote:

> Actually, because the EventHandler has a reference to the class that
> created it (in most cases, and it's true in your case), then as long as it
> is referenced by the EventBus, it won't be garbage collected, and neither
> will be its "owner" class. There's no "dead event handler", only things that
> you no longer use but haven't destroyed, so they're still there, listening
> and handling events, without anyone to notice it (because your code no
> longer has any reference on them).
> You really should clean after yourself; onLoad/onUnload on widgets might be
> a solution; but having a real lifecycle for your classes would be best (this
> is where MVP shines through, e.g. the start/onCancel/onStop methods of
> activities)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
*Jeff Schwartz*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to