mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
change the order and kill the running thread last.
This commit is contained in:
parent
b41171e8e2
commit
d7afd79e1e
1 changed files with 31 additions and 32 deletions
|
@ -264,6 +264,36 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure gdb is killed.
|
||||||
|
// FIX: the destroy() must be call before closing gdb streams
|
||||||
|
// on windows if the order is not follow the close() will hang.
|
||||||
|
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.
|
||||||
|
try {
|
||||||
|
miInPipe = null;
|
||||||
|
if (miOutPipe != null) {
|
||||||
|
miOutPipe.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
}
|
||||||
|
|
||||||
// Kill the Transmition thread.
|
// Kill the Transmition thread.
|
||||||
try {
|
try {
|
||||||
if (txThread.isAlive()) {
|
if (txThread.isAlive()) {
|
||||||
|
@ -290,37 +320,6 @@ 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.
|
|
||||||
try {
|
|
||||||
miInPipe = null;
|
|
||||||
if (miOutPipe != null) {
|
|
||||||
miOutPipe.close();
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue