Hi all,
I think there is a memory leak in the com.extjs.gxt.ui.client.widget.Dialog.
Here is a little test with a button to open a number of dialogs and a button to close them afterwards. Part of the memory is not released when closing the dialogs.
Do I have to call other cleanup methods or should dialog.close() do the job ?
Tested on IE6, FF2 and Chrome with GWT 1.5.2 and Gxt 1.1.2.
Code:
public class DialogExampleEntryPoint implements EntryPoint {
private Dialog[] dialogs;
private int NUMBER_OF_DIALOGS = 25;
public void onModuleLoad() {
LayoutContainer buttonPanel = new LayoutContainer();
ButtonBar buttons = new ButtonBar();
buttons.add(new Button("Open Multiple Dialogs",
new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
dialogs = new Dialog[NUMBER_OF_DIALOGS];
for (int i = 0; i < NUMBER_OF_DIALOGS; i++) {
dialogs[i] = new Dialog();
dialogs[i].show();
}
}
}));
buttons.add(new Button("Close Multiple Dialogs",
new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
for (int i = 0; i < NUMBER_OF_DIALOGS; i++) {
dialogs[i].close();
dialogs[i] = null;
}
dialogs = null;
}
}));
buttonPanel.add(buttons);
RootPanel.get().add(buttonPanel);
}
}