Fix Editor not released on project close

This commit is contained in:
irengrig
2011-12-14 11:04:23 +04:00
parent 233091ff90
commit 7c82cebc1d
@@ -382,6 +382,12 @@ public void addMessageToConsoleWindow(final String message, final TextAttributes
final String displayName = VcsBundle.message("vcs.console.toolwindow.display.name");
Content content = contentManager.findContent(displayName);
if (content == null) {
if (myEditorAdapter != null) {
final Editor editor = myEditorAdapter.getEditor();
if (! editor.isDisposed()) {
EditorFactory.getInstance().releaseEditor(editor);
}
}
final EditorFactory editorFactory = EditorFactory.getInstance();
final Editor editor = editorFactory.createViewer(editorFactory.createDocument(""), myProject);
EditorSettings editorSettings = editor.getSettings();