void () { isReleased = true; myDocument.removeDocumentListener(myHighlighter); myDocument.removeDocumentListener(myEditorDocumentAdapter); myDocument.removeDocumentListener(myFoldingModel); myDocument.removeDocumentListener(myCaretModel); myDocument.removeDocumentListener(mySelectionModel); MarkupModelImpl markupModel = (MarkupModelImpl)myDocument.getMarkupModel(myProject, false); if (markupModel != null) markupModel.removeMarkupModelListener(myMarkupModelListener); myMarkupModel.dispose(); myLineHeight = -1; myCharHeight = -1; myDescent = -1; myPlainFontMetrics = null; myScrollingModel.dispose(); myGutterComponent.dispose(); }