PDA

View Full Version : [FNR] Memory leak when closing a window



rzschech
6 May 2009, 3:40 PM
I have discovered a memory leak when closing a window. My profiler shows that the eventPreview is the cause.

Adding to the close method:


if (eventPreview != null) {
eventPreview.remove();
}

similar to what is in the hide method fixes the problem.

sven
7 May 2009, 6:53 AM
Fixed in SVN.

rzschech
7 May 2009, 3:33 PM
Thanks!

Also if I hide() a window then close() it, it does not get unregistered from the WindowManager as close immediately exits if the window is hidden and therefore leaks.

Showing a hidden window then closing it is a work around.

In general should hidden windows be eligible for garbage collection from the GXT point of view?

sven
7 May 2009, 3:42 PM
If you want to hide it, than you want to hide it and reuse it.

If you dont want the window anymore, than you have to close it.

rzschech
7 May 2009, 3:50 PM
OK, so closing a hidden window causes a leak too.

sven
7 May 2009, 3:53 PM
That is not the common way to go. We will look into it.