Saturday, April 30, 2011

Do you think to release handlers ?

I just realized that I never called removeHandler() on some of handler that I was using.

HandlerRegistration h = Window.addResizeHandler(new ResizeHandler() {
@Override public void onResize(ResizeEvent event) { height = event.getHeight(); width = event.getHeight(); } });
In the case of a composite that need to get a resize event, I suppose that we have to call h.removeHandler() in the onClose() method isn't it ? Or is there an automatic behaviour to release it ?
I know that it is automatic when using a Resettable event bus from activity but it is becausde it is managed by the ActivityManager.

Where is the best place to release a resize handler in a composite ?

Thanks

--
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.

No comments:

Post a Comment