Re: Remove event handlers or not?

2010-07-21 Thread Nathan Wells
The answer is no, things should get garbage collected as they would in java. Modern JavaScript engines, ie6 included, use a mark and sweep gc. On Jul 21, 5:12 pm, Thomas Broyer wrote: > On Jul 22, 12:22 am, jay wrote: > > > > > > > OK, I think this now gets into how the GWT compiler generates >

Re: Remove event handlers or not?

2010-07-21 Thread Thomas Broyer
On Jul 22, 12:22 am, jay wrote: > OK, I think this now gets into how the GWT compiler generates > JavaScript from the Java sources... Say I have something like this: > > class Foo extends HorizontalPanel { >   public Foo() { >     final Button b1 = new Button( "OK" ); >     b1.addClickHandler( n

Re: Remove event handlers or not?

2010-07-21 Thread jay
OK, I think this now gets into how the GWT compiler generates JavaScript from the Java sources... Say I have something like this: class Foo extends HorizontalPanel { public Foo() { final Button b1 = new Button( "OK" ); b1.addClickHandler( new ClickHandler() { public void onClick(Cl

Re: Remove event handlers or not?

2010-07-21 Thread Thomas Broyer
On 20 juil, 01:23, Blagoja Chavkoski wrote: > Hi, > > I have some small question related to events..but other way around: > How can we fire a native(browser) event in gwt 2.xx ?!  On 1.6 there was a > method.Document.fireXXXEvent > but not in the newer relies. DomEvent.fireNativeEvent would cal

Re: Remove event handlers or not?

2010-07-21 Thread Thomas Broyer
On 20 juil, 01:32, jay wrote: > Ah, so that's good for handlers of *DOM* events [e.g., using > addDomHandler()]. For "logical" events [those added via addHandler()], > however, it seems like you may still need to manually remove > listeners. > > Is that correct? As long as the handler don't hav

Re: Remove event handlers or not?

2010-07-20 Thread jay
Urgh. Sorry...never should have mentioned "listeners". (Old habits die hard. ) I *should* have written, "it seems like you may still need to manually remove handlers of "logical" events". jay On Jul 19, 4:32 pm, jay wrote: > Ah, so that's good for handlers of *DOM* events [e.g., using > addDomH

Re: Remove event handlers or not?

2010-07-19 Thread jay
Ah, so that's good for handlers of *DOM* events [e.g., using addDomHandler()]. For "logical" events [those added via addHandler()], however, it seems like you may still need to manually remove listeners. Is that correct? thanks! jay On Jul 19, 3:23 pm, Thomas Broyer wrote: > On 19 juil, 23:15,

Re: Remove event handlers or not?

2010-07-19 Thread Blagoja Chavkoski
Hi, I have some small question related to events..but other way around: How can we fire a native(browser) event in gwt 2.xx ?! On 1.6 there was a method.Document.fireXXXEvent but not in the newer relies. tnx! On Tue, Jul 20, 2010 at 12:23 AM, Thomas Broyer wrote: > > > On 19 juil, 23:15, jay

Re: Remove event handlers or not?

2010-07-19 Thread Thomas Broyer
On 19 juil, 23:15, jay wrote: > Where do you see the automatic removal of handlers? There's nothing > when a widget is unloaded, and I can't find anything that would do any > cleanup.  Maybe there's some code somewhere to do cleanup as the app > is shutting down? onDetach calls setEventListener

Re: Remove event handlers or not?

2010-07-19 Thread jay
Where do you see the automatic removal of handlers? There's nothing when a widget is unloaded, and I can't find anything that would do any cleanup. Maybe there's some code somewhere to do cleanup as the app is shutting down? I'm *really* interested in this because I'm in the process of tracking d

Re: Remove event handlers or not?

2010-07-14 Thread Gal Dolber
Thanks! good to hear that! 2010/7/14 Paul Stockley > You don't need to. I traced the code a while back and it takes care of > it. > > On Jul 13, 5:50 pm, Gal Dolber wrote: > > Anyone?? > > > > 2010/7/13 Gal Dolber > > > > > > > > > > > > > Hi, someone knows for sure if its necessary to remove

Re: Remove event handlers or not?

2010-07-14 Thread Paul Stockley
You don't need to. I traced the code a while back and it takes care of it. On Jul 13, 5:50 pm, Gal Dolber wrote: > Anyone?? > > 2010/7/13 Gal Dolber > > > > > > > Hi, someone knows for sure if its necessary to remove event handlers when > > we remove a widget? will I get memory leaks if I don't?

Re: Remove event handlers or not?

2010-07-13 Thread Gal Dolber
Anyone?? 2010/7/13 Gal Dolber > Hi, someone knows for sure if its necessary to remove event handlers when > we remove a widget? will I get memory leaks if I don't? > > i.e: > HandlerRegistration registration = button.addClickHandler(myHandler); > ... > // IS THIS NECESSARY? > public void fakeCle

Remove event handlers or not?

2010-07-12 Thread Gal Dolber
Hi, someone knows for sure if its necessary to remove event handlers when we remove a widget? will I get memory leaks if I don't? i.e: HandlerRegistration registration = button.addClickHandler(myHandler); ... // IS THIS NECESSARY? public void fakeCleanerMethodBeforeIRemoveTheWidget() { registr