1
0
Fork 0
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:
Alain Magloire 2002-08-13 19:54:39 +00:00
parent 9cd17db724
commit e1c79c7850

View file

@ -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.
} }