Hi, If you remove the widget from the view and you keep no reference to that widget then normally the widget will be garbage collected.
You only need to keep the HandlerRegistration and call remove if you want to stop listening to the widget, while the widget is still being used somewhere. David On Mon, Aug 10, 2009 at 6:07 PM, Arthur Kalmenson<[email protected]> wrote: > > I think that if you have handlers attached to a widget that gets > removed, it won't be garbage collected. There was a discussion about > this earlier here. I think if you hang onto the HandlerRegistration, > you can remove yourself onUnload(). > > Regards, > -- > Arthur Kalmenson > > > > On Tue, Aug 4, 2009 at 5:45 PM, Justas<[email protected]> wrote: >> >> There is an application in which a Panel instance is *Handler for >> widgets, which are added dynamically depending on the result returned >> by async call. Instances of HandlerRegistration are not maintained by >> the application (i.e. values returned by #add*Handler() are not stored >> anywhere). >> >> Now lets suppose that one of these widgets is removed from the panel >> without calling respective HandlerRegistration#removeHandler(). Will I >> have unnecessary references to the panel related to removed widget? Is >> it possible that this panel (as a Handler) will be invoked to handle >> an event (either native or logical) having removed widget as a source >> (either before or after garbage collection)? >> >> GWT 1.7, no JSNI used. >> >> > >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
