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:
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;
|
||||
}
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue