1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

Make sure we can terminate a launch before we do it.

DSF throws an exception when we try to terminate a launch that's
already terminated.

Change-Id: Ie836e1f3e182b009ba4649a27afda716e8876885
This commit is contained in:
Doug Schaefer 2016-06-03 16:30:26 -04:00
parent c4d7ecfc60
commit 62545585be

View file

@ -53,19 +53,21 @@ public class StopActiveCommandHandler extends AbstractHandler {
return Status.OK_STATUS;
}
for (ILaunch launch : activeLaunches) {
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
if (activeConfig.equals(launchConfig)) {
launch.terminate();
continue;
}
if (launchConfig instanceof ILaunchConfigurationWorkingCopy) {
// There are evil delegates that use a working
// copy for scratch storage
if (activeConfig
.equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) {
if (launch.canTerminate()) {
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
if (activeConfig.equals(launchConfig)) {
launch.terminate();
continue;
}
if (launchConfig instanceof ILaunchConfigurationWorkingCopy) {
// There are evil delegates that use a
// working copy for scratch storage
if (activeConfig
.equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) {
launch.terminate();
continue;
}
}
}
}
return Status.OK_STATUS;