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

Bug 394766: MIInferiorProcess leaks 2x LargePipedInputStreams after a

restart, added guards to avoid NPEs.
This commit is contained in:
Marc Khouzam 2012-11-27 06:39:49 -05:00
parent e1eee7dfe3
commit 01060d852e

View file

@ -328,12 +328,12 @@ public class MIInferiorProcess extends Process
private void closeIO() {
try {
fOutputStream.close();
if (fOutputStream != null) fOutputStream.close();
// Make sure things get GCed
fOutputStream = null;
} catch (IOException e) {}
try {
fInputStream.close();
if (fInputStream != null) fInputStream.close();
// Make sure things get GCed
fInputStream = null;
} catch (IOException e) {}
@ -343,12 +343,12 @@ public class MIInferiorProcess extends Process
fInputStreamPiped = null;
} catch (IOException e) {}
try {
fErrorStream.close();
if (fErrorStream != null) fErrorStream.close();
// Make sure things get GCed
fErrorStream = null;
} catch (IOException e) {}
try {
fErrorStreamPiped.close();
if (fErrorStreamPiped != null) fErrorStreamPiped.close();
// Make sure things get GCed
fErrorStreamPiped = null;
} catch (IOException e) {}