PDA

View Full Version : MessageBox.alert() memory leak



vdhanda
16 Oct 2008, 11:01 AM
Is this the best way to avoid a memory leak when using MessageBox.alert() and other static "convenience" methods in MessageBox?


MessageBox.alert("Alert", "This is an alert, new WindowListener(){
publicvoid windowHide(WindowEvent we) {
WindowManager.get().unregister(we.window);
}
}) ;

If that is the case, wouldn't it be nice to add an additional parameter to the static methods, CloseAction closeAction, which defaults to CloseAction.HIDE and is used in the implementation of each method as box.setCloseAction(closeAction).