mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-17 13:15:44 +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:
parent
c4d7ecfc60
commit
62545585be
1 changed files with 12 additions and 10 deletions
|
@ -53,19 +53,21 @@ public class StopActiveCommandHandler extends AbstractHandler {
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
for (ILaunch launch : activeLaunches) {
|
for (ILaunch launch : activeLaunches) {
|
||||||
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
|
if (launch.canTerminate()) {
|
||||||
if (activeConfig.equals(launchConfig)) {
|
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
|
||||||
launch.terminate();
|
if (activeConfig.equals(launchConfig)) {
|
||||||
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();
|
launch.terminate();
|
||||||
continue;
|
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;
|
return Status.OK_STATUS;
|
||||||
|
|
Loading…
Add table
Reference in a new issue