mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 394766: MIInferiorProcess leaks 2x LargePipedInputStreams after a
restart
This commit is contained in:
parent
236c894f33
commit
7d0f0c8ecf
1 changed files with 19 additions and 9 deletions
|
@ -77,13 +77,13 @@ public class MIInferiorProcess extends Process
|
||||||
// Indicates that the inferior has been terminated
|
// Indicates that the inferior has been terminated
|
||||||
private boolean fTerminated;
|
private boolean fTerminated;
|
||||||
|
|
||||||
private final OutputStream fOutputStream;
|
private OutputStream fOutputStream;
|
||||||
private final InputStream fInputStream;
|
private InputStream fInputStream;
|
||||||
|
|
||||||
private final PipedOutputStream fInputStreamPiped;
|
private PipedOutputStream fInputStreamPiped;
|
||||||
|
|
||||||
private final PipedInputStream fErrorStream;
|
private PipedInputStream fErrorStream;
|
||||||
private final PipedOutputStream fErrorStreamPiped;
|
private PipedOutputStream fErrorStreamPiped;
|
||||||
|
|
||||||
private final DsfSession fSession;
|
private final DsfSession fSession;
|
||||||
|
|
||||||
|
@ -328,19 +328,29 @@ public class MIInferiorProcess extends Process
|
||||||
|
|
||||||
private void closeIO() {
|
private void closeIO() {
|
||||||
try {
|
try {
|
||||||
fOutputStream.close();
|
if (fOutputStream != null) fOutputStream.close();
|
||||||
|
// Make sure things get GCed
|
||||||
|
fOutputStream = null;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
try {
|
try {
|
||||||
fInputStream.close();
|
if (fInputStream != null) fInputStream.close();
|
||||||
|
// Make sure things get GCed
|
||||||
|
fInputStream = null;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
try {
|
try {
|
||||||
if (fInputStreamPiped != null) fInputStreamPiped.close();
|
if (fInputStreamPiped != null) fInputStreamPiped.close();
|
||||||
|
// Make sure things get GCed
|
||||||
|
fInputStreamPiped = null;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
try {
|
try {
|
||||||
fErrorStream.close();
|
if (fErrorStream != null) fErrorStream.close();
|
||||||
|
// Make sure things get GCed
|
||||||
|
fErrorStream = null;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
try {
|
try {
|
||||||
fErrorStreamPiped.close();
|
if (fErrorStreamPiped != null) fErrorStreamPiped.close();
|
||||||
|
// Make sure things get GCed
|
||||||
|
fErrorStreamPiped = null;
|
||||||
} catch (IOException e) {}
|
} catch (IOException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue