mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
mem leaks: cleanup rootPane (Cancel action leaked via javax.swing.KeyboardManager) 2
This commit is contained in:
@@ -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();
|
||||
|
||||
+1
@@ -580,6 +580,7 @@ public class GlassPaneDialogWrapperPeer extends DialogWrapperPeer implements Foc
|
||||
public void dispose() {
|
||||
setVisible(false);
|
||||
remove(getContentPane());
|
||||
DialogWrapper.unregisterKeyboardActions(myWrapperPane);
|
||||
myRootPane = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user