Fix file handle leak in ObjectDownloadListener.onWritePossible
5c134f4d
removed closing the input stream when we reached end of the
stream. This caused file handle leaks.
Bug: 540049
Change-Id: I48082b537077c7471fc160f59aa04deb99687d9b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
33744a2dfe
commit
89388d67f8
|
@ -122,13 +122,18 @@ public void onWritePossible() throws IOException {
|
|||
} else {
|
||||
buffer.flip();
|
||||
}
|
||||
} catch(Throwable t) {
|
||||
} catch (Throwable t) {
|
||||
LOG.log(Level.SEVERE, t.getMessage(), t);
|
||||
buffer = null;
|
||||
} finally {
|
||||
if (buffer != null) {
|
||||
outChannel.write(buffer);
|
||||
} else {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
LOG.log(Level.SEVERE, e.getMessage(), e);
|
||||
}
|
||||
try {
|
||||
out.close();
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue