Refs #1107 Fix memory leak in GWT code for dialog windows

This commit is contained in:
Yuriy Artamonov 2012-03-16 10:37:16 +00:00
parent f8e6c739ac
commit db19248b2e
2 changed files with 7 additions and 3 deletions

View File

@ -436,12 +436,12 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
}
// Close old windows which where not in UIDL anymore
for (final Iterator<VWindow> rem = removedSubWindows.iterator(); rem
.hasNext();) {
final VWindow w = rem.next();
for (final VWindow w : removedSubWindows) {
client.unregisterPaintable(w);
subWindows.remove(w);
w.hide();
// remove window from ordering for prevent memory leak
VWindow.closeWindow(w);
}
if (uidl.hasAttribute("focused")) {

View File

@ -1332,4 +1332,8 @@ public class VWindow extends VOverlay implements Container,
contentPanel.focus();
}
// Prevent memory leaks, remove windows from windowOrder
public static void closeWindow(VWindow vWindow) {
windowOrder.remove(vWindow);
}
}