Source:
<code>protected void internalSetMapDir(final String dir, final GameData data) { <START> resourceLoader = ResourceLoader.getMapResourceLoader(dir); <END> mapData = new MapData(dir); diceImageFactory = new DiceImageFactory(resourceLoader, data.getDiceSides()); final double unitScale = getPreferencesMapOrSkin(dir).getDouble(UNIT_SCALE_PREF, mapData.getDefaultUnitScale()); scale = getPreferencesMapOrSkin(dir).getDouble(MAP_SCALE_PREF, 1); unitImageFactory.setResourceLoader( resourceLoader, unitScale, mapData.getDefaultUnitWidth(), mapData.getDefaultUnitHeight(), mapData.getDefaultUnitCounterOffsetWidth(), mapData.getDefaultUnitCounterOffsetHeight(), mapData); resourceImageFactory.setResourceLoader(resourceLoader); territoryEffectImageFactory.setResourceLoader(resourceLoader); unitIconImageFactory.setResourceLoader(resourceLoader); flagIconImageFactory.setResourceLoader(resourceLoader); puImageFactory.setResourceLoader(resourceLoader); tileImageFactory.setMapDir(resourceLoader); mapImage.loadMaps(resourceLoader); mapDir = dir; drawTerritoryEffects = mapData.useTerritoryEffectMarkers(); new Thread(() -> ClipPlayer.getInstance(resourceLoader), "TripleA sound loader").start(); cursor = Cursor.getDefaultCursor(); final Toolkit toolkit = Toolkit.getDefaultToolkit(); final URL cursorUrl = resourceLoader.getResource("misc/cursor.gif"); if (cursorUrl != null) { try { final Image image = ImageIO.read(cursorUrl); if (image != null) { final Point hotSpot = new Point(mapData.getMapCursorHotspotX(), mapData.getMapCursorHotspotY()); cursor = toolkit.createCustomCursor(image, hotSpot, data.getGameName() + " Cursor"); } } catch (final Exception e) { log.log(Level.SEVERE, "Failed to create cursor from: " + cursorUrl, e); } } }</code><technical_language>Is this resource loader closed some point now</technical_language>

Target:
protected void internalSetMapDir(final String dir, final GameData data) { if (resourceLoader != null) { resourceLoader.close(); } resourceLoader = ResourceLoader.getMapResourceLoader(dir); mapData = new MapData(dir); diceImageFactory = new DiceImageFactory(resourceLoader, data.getDiceSides()); final double unitScale = getPreferencesMapOrSkin(dir).getDouble(UNIT_SCALE_PREF, mapData.getDefaultUnitScale()); scale = getPreferencesMapOrSkin(dir).getDouble(MAP_SCALE_PREF, 1); unitImageFactory.setResourceLoader( resourceLoader, unitScale, mapData.getDefaultUnitWidth(), mapData.getDefaultUnitHeight(), mapData.getDefaultUnitCounterOffsetWidth(), mapData.getDefaultUnitCounterOffsetHeight(), mapData); resourceImageFactory.setResourceLoader(resourceLoader); territoryEffectImageFactory.setResourceLoader(resourceLoader); unitIconImageFactory.setResourceLoader(resourceLoader); flagIconImageFactory.setResourceLoader(resourceLoader); puImageFactory.setResourceLoader(resourceLoader); tileImageFactory.setMapDir(resourceLoader); mapImage.loadMaps(resourceLoader); mapDir = dir; drawTerritoryEffects = mapData.useTerritoryEffectMarkers(); new Thread(() -> ClipPlayer.getInstance(resourceLoader), "TripleA sound loader").start(); cursor = Cursor.getDefaultCursor(); final Toolkit toolkit = Toolkit.getDefaultToolkit(); final URL cursorUrl = resourceLoader.getResource("misc/cursor.gif"); if (cursorUrl != null) { try { final Image image = ImageIO.read(cursorUrl); if (image != null) { final Point hotSpot = new Point(mapData.getMapCursorHotspotX(), mapData.getMapCursorHotspotY()); cursor = toolkit.createCustomCursor(image, hotSpot, data.getGameName() + " Cursor"); } } catch (final Exception e) { log.log(Level.SEVERE, "Failed to create cursor from: " + cursorUrl, e); } } }