summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dumais2013-02-06 10:43:34 (EST)
committerWilliam Swanson2013-02-06 10:49:19 (EST)
commit0d41eeea6cdcd877cbafeadef7eea5b142aa43cf (patch)
tree1030909643ec204010ee4b5bec8f40836034f338
parentffe8836c1b7163e90535f99672feeb54f0ddd1c2 (diff)
downloadorg.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.zip
org.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.tar.gz
org.eclipse.cdt-0d41eeea6cdcd877cbafeadef7eea5b142aa43cf.tar.bz2
Bug 399281 - MulticoreVisualizer: disposeVisualizer() is not gettingrefs/changes/13/10113/4
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>
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java10
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java9
-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
4 files changed, 31 insertions, 9 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
index f3f7ac3..f9ea96a 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
@@ -8,6 +8,7 @@
* Contributors:
* William R. Swanson (Tilera Corporation) - initial API and implementation
* IBM Corporation
+ * Marc Dumais (Ericsson) - Bug 399281
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -705,10 +706,11 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
protected void setCanvasModel(VisualizerModel model) {
final VisualizerModel model_f = model;
GUIUtils.exec(new Runnable() { @Override public void run() {
- m_canvas.setModel(model_f);
-
- // Update the canvas's selection from the current workbench selection.
- updateCanvasSelectionInternal();
+ if(m_canvas != null) {
+ m_canvas.setModel(model_f);
+ // Update the canvas's selection from the current workbench selection.
+ updateCanvasSelectionInternal();
+ }
}});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
index 291a5a9..093501c 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
@@ -11,6 +11,7 @@
* Marc Dumais (Ericsson) - Bug 396184
* Marc Dumais (Ericsson) - Bug 396200
* Marc Dumais (Ericsson) - Bug 396293
+ * Marc Dumais (Ericsson) - Bug 399281
*******************************************************************************/
package org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.view;
@@ -303,7 +304,9 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
*/
public void requestUpdate() {
GUIUtils.exec(new Runnable() { @Override public void run() {
- m_updateTimer.start();
+ if (m_updateTimer != null) {
+ m_updateTimer.start();
+ }
}});
}
@@ -867,7 +870,9 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas
/** Removes external listener for selection change events. */
@Override
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/VisualizerViewer.java b/visualizer/org.eclipse.cdt.visualizer.ui/src/org/eclipse/cdt/visualizer/ui/VisualizerViewer.java
index a9c71c2..344e3cd 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 b4f2778..e2112ab 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;