Ticket #23414: 23414.patch
File 23414.patch, 1.6 KB (added by , 14 months ago) |
---|
-
src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
146 146 private static void destroyInstance() { 147 147 MapFrame map = MainApplication.getMap(); 148 148 synchronized (ImageViewerDialog.class) { 149 if (dialog != null && map != null && map.getToggleDialog(ImageViewerDialog.class) != null) { 150 map.removeToggleDialog(dialog); 149 if (dialog != null) { 150 if (map != null && map.getToggleDialog(ImageViewerDialog.class) != null) { 151 map.removeToggleDialog(dialog); 152 } 153 dialog.destroy(); 151 154 } 152 155 } 153 156 dialog = null; … … 302 305 .filter(IGeoImageLayer.class::isInstance).map(IGeoImageLayer.class::cast).collect(Collectors.toList()); 303 306 if (geoImageLayers.isEmpty()) { 304 307 this.layers.setVisible(false); 308 hideNotify(); 309 if (hasInstance()) 310 destroyInstance(); 305 311 } else { 306 312 this.layers.setVisible(true); 307 313 if (changed) { … … 416 422 imageRemoveAction.destroy(); 417 423 imageRemoveFromDiskAction.destroy(); 418 424 imageZoomAction.destroy(); 425 toggleAction.destroy(); 419 426 cancelLoadingImage(); 420 427 super.destroy(); 421 destroyInstance();422 428 } 423 429 424 430 /**