diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/LSPConsoleToolWindowPanel.java b/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/LSPConsoleToolWindowPanel.java index 6048e9606..9d77eb1c1 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/LSPConsoleToolWindowPanel.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4ij/console/LSPConsoleToolWindowPanel.java @@ -115,6 +115,11 @@ protected ConsoleContentPanel create(DefaultMutableTreeNode key) { return new ConsoleContentPanel(key); } + @Override + public void dispose() { + removeAll(); + } + @Override protected void dispose(DefaultMutableTreeNode key, ConsoleContentPanel value) { if (value != null) { @@ -206,6 +211,14 @@ private void showDetail() { public void showMessage(String message) { consoleView.print(message, ConsoleViewContentType.SYSTEM_OUTPUT); } + + @Override + public void dispose() { + super.dispose(); + if(consoleView != null) { + consoleView.dispose(); + } + } } private ConsoleView createConsoleView(@NotNull LanguageServersRegistry.LanguageServerDefinition serverDefinition, @NotNull Project project) { @@ -227,6 +240,9 @@ public void showMessage(LanguageServerProcessTreeNode processTreeNode, String me @Override public void dispose() { disposed = true; + if (consoles != null) { + consoles.dispose(); + } explorer.dispose(); }