Changeset 18605 in josm for trunk


Ignore:
Timestamp:
2022-11-28T18:46:35+01:00 (2 years ago)
Author:
taylor.smock
Message:

See #21605, fix #22522: RejectedExecutionException closing JOSM with open image viewer

This is caused by layer cleanup, which attempts to set the image to null.
This fails since the MainApplication.worker is shutdown.

Additionally, the layer cleanup code was not sending the removed layer to the
image viewer, so it was not always properly cleaning up a layer.

Location:
trunk/src/org/openstreetmap/josm/gui/layer/geoimage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java

    r18503 r18605  
    636636    public Future<?> setImage(IImageEntry<?> entry) {
    637637        LoadImageRunnable runnable = setImage0(entry);
    638         return runnable != null ? MainApplication.worker.submit(runnable) : null;
     638        return runnable != null && !MainApplication.worker.isShutdown() ? MainApplication.worker.submit(runnable) : null;
    639639    }
    640640
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r18599 r18605  
    908908            ImageData removedData = ((GeoImageLayer) e.getRemovedLayer()).getImageData();
    909909            if (removedData == ((ImageEntry) this.currentEntry).getDataSet()) {
    910                 displayImages(null);
     910                displayImages(e.getRemovedLayer(), null);
    911911            }
    912912            removedData.removeImageDataUpdateListener(this);
Note: See TracChangeset for help on using the changeset viewer.