Hi Peter, I´m not sure if i got your question right but I think the activities and places pattern could help you. Normally, you have to care about the unloading of your handlers, but within the activity framework, GWT handles all the handler unloading as soon as you stop the activity (remove the presenter). It shouldn´t be to hard to port an existing mvp app into activities and places. I could be wrong, because I´m also not that experienced, but I think this is the way to achieve this.
Cheers, Mike On 30 Mrz., 19:58, pete <[email protected]> wrote: > Hallo, > > I'm not sure how GWT handles this, so I want to evaluate a short > example scenario for memory leaks. Suppose I write my own handler > > public Interface BlubbHandler { > void onBlubb(BlubbEvent event); > > } > > have my presenter > > public class MyPresenter { > private final MyView view; > private final StringContainer justToBeFinal; > > @Inject > public MyPresenter(MyView view) { > this.view = view; > view.addBlubbHandler(new BlubbHandler(){ > justToBeFinal.setText("BLUBB"); > }); > } > > } > > and now my Widget is disposed. Will the memory it uses ever be freed? > Or does the reference to view prevent view from being disposed, and > the reference of view's BlubbHandler to justToBeFinal prevent > MyPresenter to be disposed? > I'm not even sure, how it would be in Java, but I think in Java this > would cause a memory leak, wouldn't it? > So do I have to add a dispose() method to pesenter, that must be > called to null out the BlubbHandlers of view? > And how is this handled with GWT's own event system? Or with event > systems constructed on top of GWTs own one, using SimpleEventBus and > extending / implementing GWT's classes? > > Anyone who is more versatile in these matters and can help me would be > very appreciated :-) I don't want to find out after lines and lines of > code, that I'm memory leaking like stupid... > Greetz, > Peter -- 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.
