langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
changeset 40517 611ca58fca75
parent 40498 f54048be4a57
child 40606 eb2c81860c86
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Mon Aug 22 09:12:11 2016 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Mon Aug 22 18:19:31 2016 +0200
@@ -1196,6 +1196,11 @@
                     fm.setLocationFromPaths(StandardLocation.SOURCE_PATH, sources);
                 } catch (IOException ex) {
                     proc.debug(ex, "SourceCodeAnalysisImpl.SourceCache.<init>(...)");
+                    try {
+                        fm.close();
+                    } catch (IOException closeEx) {
+                        proc.debug(closeEx, "SourceCodeAnalysisImpl.SourceCache.close()");
+                    }
                     fm = null;
                 }
                 this.fm = fm;