Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-02-06 15:43:34 +0000
committerWilliam Swanson2013-02-06 15:49:19 +0000
commit0d41eeea6cdcd877cbafeadef7eea5b142aa43cf (patch)
tree1030909643ec204010ee4b5bec8f40836034f338 /visualizer
parentffe8836c1b7163e90535f99672feeb54f0ddd1c2 (diff)
downloadorg.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.tar.gz
org.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.tar.xz
org.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.zip
Bug 399281 - MulticoreVisualizer: disposeVisualizer() is not getting
called when visualizer view is closed Change-Id: Ibd80373986af0fdedde42146862f89cdcded7099 Reviewed-on: https://git.eclipse.org/r/10113 Reviewed-by: William Swanson <traveler@tilera.com> IP-Clean: William Swanson <traveler@tilera.com> Tested-by: William Swanson <traveler@tilera.com>
Diffstat (limited to 'visualizer')
-rw-r--r--visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java14
-rwxr-xr-xvisualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java7
2 files changed, 18 insertions, 3 deletions
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java
index a9c71c2d1b3..344e3cddf94 100644
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java
@@ -7,6 +7,7 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation)
+ * Marc Dumais (Ericsson) - Bug 399281
*******************************************************************************/
package org.eclipse.cdt.visualizer.ui;
@@ -29,6 +30,8 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.events.PaintEvent;
@@ -97,6 +100,13 @@ public class VisualizerViewer extends PageBook
public VisualizerViewer(VisualizerView view, Composite parent) {
super(parent, SWT.NONE);
initVisualizerViewer(view, parent);
+ // so we're notified when the widget is disposed
+ addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ dispose();
+ }
+ });
}
/** Dispose method. */
@@ -431,7 +441,9 @@ public class VisualizerViewer extends PageBook
/** Removes external listener for selection change events. */
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- m_selectionManager.removeSelectionChangedListener(listener);
+ if(m_selectionManager != null) {
+ m_selectionManager.removeSelectionChangedListener(listener);
+ }
}
/** Raises selection changed event. */
diff --git a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java
index b4f2778cef4..e2112ab95fd 100755
--- a/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java
+++ b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/canvas/BufferedCanvas.java
@@ -7,6 +7,7 @@
*
* Contributors:
* William R. Swanson (Tilera Corporation)
+ * Marc Dumais (Ericsson) - Bug 399281
*******************************************************************************/
package org.eclipse.cdt.visualizer.ui.canvas;
@@ -68,8 +69,10 @@ public class BufferedCanvas extends Canvas
/** Cleans up control. */
protected void cleanupBufferedCanvas() {
- removePaintListener(this);
- removeControlListener(this);
+ if(!this.isDisposed()) {
+ removePaintListener(this);
+ removeControlListener(this);
+ }
if (m_doubleBuffer != null) {
m_doubleBuffer.dispose();
m_doubleBuffer = null;

Back to the top