1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Do not try to get the exit value if the session is terminated.

This commit is contained in:
Alain Magloire 2002-08-21 16:02:10 +00:00
parent d5fbd8f312
commit d6695357c3

View file

@ -118,15 +118,17 @@ public class MIInferior extends Process {
* @see java.lang.Process#exitValue() * @see java.lang.Process#exitValue()
*/ */
public int exitValue() { public int exitValue() {
if (isTerminated() && !session.isTerminated()) { if (isTerminated()) {
CommandFactory factory = session.getCommandFactory(); if (!session.isTerminated()) {
MIGDBShowExitCode code = factory.createMIGDBShowExitCode(); CommandFactory factory = session.getCommandFactory();
try { MIGDBShowExitCode code = factory.createMIGDBShowExitCode();
session.postCommand(code); try {
MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo(); session.postCommand(code);
return info.getCode(); MIGDBShowExitCodeInfo info = code.getMIGDBShowExitCodeInfo();
} catch (MIException e) { return info.getCode();
return 0; } catch (MIException e) {
return 0;
}
} }
} }
throw new IllegalThreadStateException(); throw new IllegalThreadStateException();