/** get ready to close, set all local references to null, to assist garbage collection */ public void close() { // we'll also try to remove all of the tools final Enumeration<MenuItemInfo> iter = _theTools.elements(); while (iter.hasMoreElements()) { final MenuItemInfo mn = iter.nextElement(); mn.close(); } // clear the dangling reference to the undo buffer _rightClicker.closeMe(); _toteAdapter = null; // clear the file drop listener if (_dropSupport != null) _dropSupport.removeComponent(getChart().getPanel()); _dropSupport.removeFileDropListener(this); // now remove references to the tools themselves _theTools.removeAllElements(); _theChart.close(); _theChart = null; if (_theTote != null) { _theTote.closeMe(); _theTote = null; } if (_theToolbar != null) _theToolbar.close(); _theToolbar = null; _theProperties = null; _theStatusBar = null; _theSession = null; }