mem leaks: cleanup rootPane (Cancel action leaked via javax.swing.KeyboardManager) 2

This commit is contained in:
Gregory.Shrago
2016-12-19 02:43:42 +03:00
parent 8719a0be53
commit 265d54fd9e
2 changed files with 2 additions and 1 deletions
@@ -967,7 +967,7 @@ public abstract class DialogWrapper {
});
}
private static void unregisterKeyboardActions(@Nullable JRootPane rootPane) {
public static void unregisterKeyboardActions(@Nullable Component rootPane) {
int[] flags = {JComponent.WHEN_FOCUSED, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, JComponent.WHEN_IN_FOCUSED_WINDOW};
for (JComponent eachComp : UIUtil.uiTraverser(rootPane).traverse().filter(JComponent.class)) {
ActionMap actionMap = eachComp.getActionMap();
@@ -580,6 +580,7 @@ public class GlassPaneDialogWrapperPeer extends DialogWrapperPeer implements Foc
public void dispose() {
setVisible(false);
remove(getContentPane());
DialogWrapper.unregisterKeyboardActions(myWrapperPane);
myRootPane = null;
}