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
|
||||
private boolean fTerminated;
|
||||
|
||||
private final OutputStream fOutputStream;
|
||||
private final InputStream fInputStream;
|
||||
private OutputStream fOutputStream;
|
||||
private InputStream fInputStream;
|
||||
|
||||
private final PipedOutputStream fInputStreamPiped;
|
||||
private PipedOutputStream fInputStreamPiped;
|
||||
|
||||
private final PipedInputStream fErrorStream;
|
||||
private final PipedOutputStream fErrorStreamPiped;
|
||||
private PipedInputStream fErrorStream;
|
||||
private PipedOutputStream fErrorStreamPiped;
|
||||
|
||||
private final DsfSession fSession;
|
||||
|
||||
|
@ -328,19 +328,29 @@ 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) {}
|
||||
try {
|
||||
if (fInputStreamPiped != null) fInputStreamPiped.close();
|
||||
// Make sure things get GCed
|
||||
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) {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue