1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 373376: remove Debug View listener in visualizer's dispose method

This commit is contained in:
William R. Swanson 2012-03-07 10:49:00 -05:00
parent baeccceba6
commit 26af0a8189

View file

@ -102,6 +102,9 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
/** Cached reference to Debug View viewer. */
protected TreeModelViewer m_debugViewer = null;
/** Model changed listener, attached to Debug View. */
protected IModelChangedListener m_modelChangedListener = null;
// --- UI members ---
@ -151,6 +154,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
public void dispose()
{
super.dispose();
removeDebugViewerListener();
disposeActions();
}
@ -478,7 +482,13 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
* Debug View updates (which it doesn't bother to properly
* communicate to the rest of the world, sigh).
*/
public void updateDebugViewListener()
protected void updateDebugViewListener()
{
attachDebugViewerListener();
}
/** Attaches debug viewer listener. */
protected void attachDebugViewerListener()
{
// NOTE: debug viewer might not exist yet, so we
// attach the listener at the first opportunity to do so.
@ -501,6 +511,18 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
}
}
/** Removes debug viewer listener. */
protected void removeDebugViewerListener()
{
if (m_modelChangedListener != null) {
if (m_debugViewer != null) {
m_debugViewer.removeModelChangedListener(m_modelChangedListener);
m_debugViewer = null;
m_modelChangedListener = null;
}
}
}
/**
* Invoked by VisualizerViewer when workbench selection changes.
*/