diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/PropertiesI.java | 17 | ||||
-rw-r--r-- | java/src/IceSSL/Instance.java | 11 |
2 files changed, 27 insertions, 1 deletions
diff --git a/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java index 78846e25241..0c97067f201 100644 --- a/java/src/Ice/PropertiesI.java +++ b/java/src/Ice/PropertiesI.java @@ -286,9 +286,10 @@ public final class PropertiesI implements Properties public void load(String file) { + java.io.InputStream is = null; try { - java.io.InputStream is = IceInternal.Util.openResource(getClass().getClassLoader(), file); + is = IceInternal.Util.openResource(getClass().getClassLoader(), file); if(is == null) { FileException fe = new FileException(); @@ -306,6 +307,20 @@ public final class PropertiesI implements Properties fe.initCause(ex); // Exception chaining throw fe; } + finally + { + if(is != null) + { + try + { + is.close(); + } + catch(Throwable ex) + { + // Ignore. + } + } + } } public synchronized Properties diff --git a/java/src/IceSSL/Instance.java b/java/src/IceSSL/Instance.java index 7314a839fe1..5f58c8154b2 100644 --- a/java/src/IceSSL/Instance.java +++ b/java/src/IceSSL/Instance.java @@ -258,6 +258,17 @@ class Instance e.initCause(ex); throw e; } + finally + { + try + { + in.close(); + } + catch(java.io.IOException e) + { + // Ignore. + } + } } rand.setSeed(seed); } |