File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/com/jdimension/jlawyer/client Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -902,12 +902,14 @@ public void run() {
902902 rootModule .setRandomBackgroundImage (null );
903903 } else {
904904 rootModule .setBackgroundImage (null );
905+
906+ FileSystem fileSystem =null ;
905907 try {
906908
907909 URI uri = Main .class .getResource ("/themes/default/backgroundsrandom" ).toURI ();
908910 Path path ;
909911 if (uri .getScheme ().equals ("jar" )) {
910- FileSystem fileSystem = FileSystems .newFileSystem (uri , Collections .<String , Object >emptyMap ());
912+ fileSystem = FileSystems .newFileSystem (uri , Collections .<String , Object >emptyMap ());
911913 path = fileSystem .getPath ("/themes/default/backgroundsrandom" );
912914
913915 } else {
@@ -932,6 +934,14 @@ public void run() {
932934 log .error ("unable to get random background image" , t );
933935 rootModule .setBackgroundImage ("archivefiles.jpg" );
934936 rootModule .setRandomBackgroundImage (null );
937+ } finally {
938+ if (fileSystem !=null ) {
939+ try {
940+ fileSystem .close ();
941+ } catch (Exception ex ) {
942+ log .warn ("Could not close filesystem object" , ex );
943+ }
944+ }
935945 }
936946
937947 }
You can’t perform that action at this time.
0 commit comments