mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Change the order of the close.
This commit is contained in:
parent
3497250607
commit
c437685dfd
1 changed files with 13 additions and 8 deletions
|
@ -249,6 +249,14 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
|
||||||
// The Event Thread is being kill below.
|
// The Event Thread is being kill below.
|
||||||
notifyObservers(new MIGDBExitEvent());
|
notifyObservers(new MIGDBExitEvent());
|
||||||
|
|
||||||
|
// {in,out}Channel is use as predicate/condition
|
||||||
|
// in the {RX,TX,Event}Thread to detect termination
|
||||||
|
// and bail out. So they are set to null.
|
||||||
|
InputStream inGDB = inChannel;
|
||||||
|
inChannel = null;
|
||||||
|
OutputStream outGDB = outChannel;
|
||||||
|
outChannel = null;
|
||||||
|
|
||||||
// send the exit(-gdb-exit).
|
// send the exit(-gdb-exit).
|
||||||
try {
|
try {
|
||||||
MIGDBExit exit = factory.createMIGDBExit();
|
MIGDBExit exit = factory.createMIGDBExit();
|
||||||
|
@ -258,20 +266,17 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
|
||||||
|
|
||||||
// Close the input GDB prompt
|
// Close the input GDB prompt
|
||||||
try {
|
try {
|
||||||
if (inChannel != null)
|
if (inGDB != null)
|
||||||
inChannel.close();
|
inGDB.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
inChannel = null;
|
|
||||||
|
|
||||||
// Close the output GDB prompt
|
// Close the output GDB prompt
|
||||||
try {
|
try {
|
||||||
if (outChannel != null)
|
if (outGDB != null)
|
||||||
outChannel.close();
|
outGDB.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
// This is __needed__ to stop the txThread and eventThread.
|
|
||||||
outChannel = null;
|
|
||||||
|
|
||||||
// Kill the Transmition thread.
|
// Kill the Transmition thread.
|
||||||
try {
|
try {
|
||||||
|
@ -309,7 +314,7 @@ MIPlugin.getDefault().debugLog(number++ + " " + cmd.toString());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure it gdb is killed.
|
// Make sure gdb is killed.
|
||||||
// FIX: Spawner will do the waitFor();
|
// FIX: Spawner will do the waitFor();
|
||||||
if (miProcess != null) {
|
if (miProcess != null) {
|
||||||
miProcess.destroy();
|
miProcess.destroy();
|
||||||
|
|
Loading…
Add table
Reference in a new issue