Tuesday, October 27, 2009

Re: Is there a easy way to remove all the widgets in a cpanel?

Provided you stick to standard GWT and extend existing GWT widgets (or Composite), and use the built-in addXxxHandler methods, then you won't get any memory leaks.

Or if you are, then report it as a bug, since GWT aims to ensure that there are no memory leaks if GWT is used normally.

Ian

http://examples.roughian.com


2009/10/27 Eric <erjablow@gmail.com>

On Oct 26, 6:32 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> Would you like to expand on your reasoning behind that comment?
>
> Ian
>
> http://examples.roughian.com
>
> 2009/10/26 Eric <erjab...@gmail.com>
>
> > If you program creates handlers and attaches them to the panel,
> > simply deleting the panel and recreating it risks memory leaks.
>
> > Respectfully,
> > Eric Jablow

Suppose your panel contains a custom widget where you create
a handler as a non-static inner class, and suppose you add that
handler to another object outside the panel.  Unless you are careful
to remove the handler when you reset the panel, the handler still
holds a reference to its enclosing widget, and the widget cannot
be garbage-collected.  It's an old problem in the Swing world.

I wrote things slightly backwards earlier.  Sorry about that.

Respectfully,
Eric Jablow




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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate