diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java index 7d677614840..f7b21796c3c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java @@ -364,8 +364,11 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr new IStatus[] { getStatus() }, "Session shutdown failed", null)); //$NON-NLS-1$ } // Last order of business, shutdown the dispatch queue. - fTracker.dispose(); - fTracker = null; + if (fTracker != null) { + fTracker.dispose(); + fTracker = null; + } + DsfSession.endSession(fSession); // 'fireTerminate()' removes this launch from the list @@ -390,12 +393,16 @@ public class GdbLaunch extends DsfLaunch implements ITerminate, IDisconnect, ITr final Step[] steps = new Step[] { new Step() { @Override public void execute(RequestMonitor rm) { - IGDBControl control = fTracker.getService(IGDBControl.class); - if (control == null) { - rm.done(); - return; + if (fTracker != null) { + IGDBControl control = fTracker.getService(IGDBControl.class); + if (control != null) { + control.terminate(rm); + return; + } } - control.terminate(rm); + + rm.done(); + return; } },