mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Bug 373376: remove Debug View listener in visualizer's dispose method
This commit is contained in:
parent
baeccceba6
commit
26af0a8189
1 changed files with 23 additions and 1 deletions
|
@ -102,6 +102,9 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
|
||||||
/** Cached reference to Debug View viewer. */
|
/** Cached reference to Debug View viewer. */
|
||||||
protected TreeModelViewer m_debugViewer = null;
|
protected TreeModelViewer m_debugViewer = null;
|
||||||
|
|
||||||
|
/** Model changed listener, attached to Debug View. */
|
||||||
|
protected IModelChangedListener m_modelChangedListener = null;
|
||||||
|
|
||||||
|
|
||||||
// --- UI members ---
|
// --- UI members ---
|
||||||
|
|
||||||
|
@ -151,6 +154,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
|
||||||
public void dispose()
|
public void dispose()
|
||||||
{
|
{
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
removeDebugViewerListener();
|
||||||
disposeActions();
|
disposeActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,7 +482,13 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer
|
||||||
* Debug View updates (which it doesn't bother to properly
|
* Debug View updates (which it doesn't bother to properly
|
||||||
* communicate to the rest of the world, sigh).
|
* 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
|
// NOTE: debug viewer might not exist yet, so we
|
||||||
// attach the listener at the first opportunity to do so.
|
// 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.
|
* Invoked by VisualizerViewer when workbench selection changes.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue