mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Check for terminate first when destroy()
This commit is contained in:
parent
9cd17db724
commit
e1c79c7850
1 changed files with 11 additions and 9 deletions
|
@ -110,15 +110,17 @@ public class MIProcess extends Process {
|
||||||
* @see java.lang.Process#destroy()
|
* @see java.lang.Process#destroy()
|
||||||
*/
|
*/
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
CommandFactory factory = session.getCommandFactory();
|
if (!isTerminated()) {
|
||||||
MIExecAbort abort = factory.createMIExecAbort();
|
CommandFactory factory = session.getCommandFactory();
|
||||||
CLICommand yes = new CLICommand("yes") {
|
MIExecAbort abort = factory.createMIExecAbort();
|
||||||
public void setToken() { }
|
CLICommand yes = new CLICommand("yes") {
|
||||||
};
|
public void setToken() { }
|
||||||
try {
|
};
|
||||||
session.postCommand(abort);
|
try {
|
||||||
session.postCommand(yes);
|
session.postCommand(abort);
|
||||||
} catch (MIException e) {
|
session.postCommand(yes);
|
||||||
|
} catch (MIException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Do not wait for answer.
|
// Do not wait for answer.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue