avoid selection listener leak
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Tue, 18 Aug 2015 13:20:52 +0000 (16:20 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Tue, 18 Aug 2015 16:06:32 +0000 (19:06 +0300)
java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XStandaloneVariablesView.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesView.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XVariablesViewBase.java

index a35f008e6f3163aa9b1eb4060130bde4fffa05e6..96e837559c38f63ff83ea43252e1fede690349bd 100644 (file)
@@ -148,10 +148,6 @@ public class VariablesPanel extends DebuggerTreePanel implements DataProvider {
       }
     }
 
-    @Override
-    protected void clear() {
-    }
-
     @Override
     public void processSessionEvent(@NotNull SessionEvent event) {
     }
index f9114642687843e3fcfc1ff0f8ea2a7808eb3b13..1cf2283c240a4cbdd88d6fd5dd63ea180e0ae6b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,8 +46,4 @@ public class XStandaloneVariablesView extends XVariablesViewBase {
   @Override
   public void processSessionEvent(@NotNull SessionEvent event) {
   }
-
-  @Override
-  protected void clear() {
-  }
 }
index 2f8bdb668e9c4fe3bc8be6b61053ecdabbf09e30..464951acf2723c54cee4dcfb734b0c37e60da19a 100644 (file)
@@ -103,6 +103,7 @@ public class XVariablesView extends XVariablesViewBase {
       node = createInfoMessage(tree, debugProcess.getCurrentStateMessage(), debugProcess.getCurrentStateHyperlinkListener());
     }
     tree.setRoot(node, true);
+    super.clear();
   }
 
   public static class InlineVariablesInfo {
index 7b5fba1ad1927a72c3bc657c495cec035dfb17d0..2d3116192cdca68b019d4b88860eb728a09320aa 100644 (file)
@@ -112,6 +112,11 @@ public abstract class XVariablesViewBase extends XDebugView {
     }
   }
 
+  @Override
+  protected void clear() {
+    removeSelectionListener();
+  }
+
   private void disposeTreeRestorer() {
     if (myTreeRestorer != null) {
       myTreeRestorer.dispose();