fix memory leaks in AccessibleJTree

(cherry picked from commit 561a7b8def)
This commit is contained in:
Konstantin Aleev
2020-04-23 12:29:26 +03:00
committed by alexey.ushakov@jetbrains.com
parent 469ae8d591
commit 048b3402cf
2 changed files with 1 additions and 10 deletions

View File

@@ -133,7 +133,7 @@ class CAccessible extends CFRetainedResource implements Accessible {
}
}
} else if (name.equals(ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY)) {
if (newValue instanceof AccessibleContext) {
if (newValue == null || newValue instanceof AccessibleContext) {
activeDescendant = (AccessibleContext)newValue;
if (newValue instanceof Accessible) {
Accessible a = (Accessible)newValue;

View File

@@ -4268,9 +4268,6 @@ public class JTree extends JComponent implements Scrollable, Accessible
implements AccessibleSelection, TreeSelectionListener,
TreeModelListener, TreeExpansionListener {
TreePath leadSelectionPath;
Accessible leadSelectionAccessible;
/**
* Constructs {@code AccessibleJTree}
*/
@@ -4282,12 +4279,6 @@ public class JTree extends JComponent implements Scrollable, Accessible
}
JTree.this.addTreeExpansionListener(this);
JTree.this.addTreeSelectionListener(this);
leadSelectionPath = JTree.this.getLeadSelectionPath();
leadSelectionAccessible = (leadSelectionPath != null)
? new AccessibleJTreeNode(JTree.this,
leadSelectionPath,
JTree.this)
: null;
}
/**