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()
*/
public void destroy() {
CommandFactory factory = session.getCommandFactory();
MIExecAbort abort = factory.createMIExecAbort();
CLICommand yes = new CLICommand("yes") {
public void setToken() { }
};
try {
session.postCommand(abort);
session.postCommand(yes);
} catch (MIException e) {
if (!isTerminated()) {
CommandFactory factory = session.getCommandFactory();
MIExecAbort abort = factory.createMIExecAbort();
CLICommand yes = new CLICommand("yes") {
public void setToken() { }
};
try {
session.postCommand(abort);
session.postCommand(yes);
} catch (MIException e) {
}
}
// Do not wait for answer.
}