void () { try (LockToken ignored = acquireLock()) { myTree.removeTreeExpansionListener(myExpansionListener); myTree.removeTreeSelectionListener(mySelectionListener); myTree.removeFocusListener(myFocusListener); disposeNode(getRootNode()); myElementToNodeMap.clear(); getUpdater().cancelAllRequests(); myWorker.clear(); clearWorkerTasks(); TREE_NODE_WRAPPER.setValue(null); if (myProgress != null) { myProgress.cancel(); } cancelCurrentCleanupTask(); myTree = null; setUpdater(null); myTreeStructure = null; myBuilder.releaseUi(); myBuilder = null; clearNodeActions(); myDeferredSelections.clear(); myDeferredExpansions.clear(); myYieldingDoneRunnables.clear(); } }