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

Rearranging shutdown sequence because of race on Windows.

This commit is contained in:
Alain Magloire 2002-09-25 20:02:41 +00:00
parent 187811636e
commit d25d3e05c5

View file

@ -191,10 +191,10 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
// Test if we are in the right state? // Test if we are in the right state?
if (inferior.isRunning()) { if (inferior.isRunning()) {
if ( !((cmd instanceof MIExecInterrupt) || // REMINDER: if we support -exec-interrupt
cmd instanceof MIExecAbort)) { // Let it throught:
throw new MIException("Target running"); // if (cmd instanceof MIExecInterrupt) { }
} throw new MIException("Target running");
} }
txQueue.addCommand(cmd); txQueue.addCommand(cmd);
@ -241,7 +241,7 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
*/ */
public void terminate() { public void terminate() {
// Destroy any MI Inferior(Process) // Destroy any MI Inferior(Process) and streams.
inferior.destroy(); inferior.destroy();
// Tell the observers that the session // Tell the observers that the session
@ -264,20 +264,6 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
} catch (MIException e) { } catch (MIException e) {
} }
// Close the input GDB prompt
try {
if (inGDB != null)
inGDB.close();
} catch (IOException e) {
}
// Close the output GDB prompt
try {
if (outGDB != null)
outGDB.close();
} catch (IOException e) {
}
// Kill the Transmition thread. // Kill the Transmition thread.
try { try {
if (txThread.isAlive()) { if (txThread.isAlive()) {
@ -304,6 +290,27 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }
// Make sure gdb is killed.
// FIX: Spawner will do the waitFor();
if (miProcess != null) {
miProcess.destroy();
}
// Close the input GDB prompt
try {
if (inGDB != null)
inGDB.close();
} catch (IOException e) {
}
// Close the output GDB prompt
try {
if (outGDB != null)
outGDB.close();
} catch (IOException e) {
}
// Destroy the MI console stream. // Destroy the MI console stream.
try { try {
@ -314,11 +321,6 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
} catch (IOException e) { } catch (IOException e) {
} }
// Make sure gdb is killed.
// FIX: Spawner will do the waitFor();
if (miProcess != null) {
miProcess.destroy();
}
} }
/** /**