Changeset 18729 in josm for trunk


Ignore:
Timestamp:
2023-05-16T18:32:14+02:00 (12 months ago)
Author:
taylor.smock
Message:

Fix #22922: RejectedExecutionException during JOSM shutdown when user has multiple geotagged image layers

The reason this occurs is that the ImageViewerDialog listens for layer removal
events and updates the image tabs based off of the removed layer and which layers
are remaining.

File:
1 edited

Legend:

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

    r18705 r18729  
    178178        // This listener gets called _prior to_ the reorder event. If we do not delay the execution of the
    179179        // model update, then the image will change instead of remaining the same.
    180         this.layers.getModel().addChangeListener(l -> MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> {
    181             Component selected = this.layers.getSelectedComponent();
    182             if (selected instanceof MoveImgDisplayPanel) {
    183                 ((MoveImgDisplayPanel<?>) selected).fireModelUpdate();
    184             }
    185         })));
     180        this.layers.getModel().addChangeListener(l -> {
     181            // We need to check to see whether or not the worker is shut down. See #22922 for details.
     182            if (!MainApplication.worker.isShutdown()) {
     183                MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> {
     184                    Component selected = this.layers.getSelectedComponent();
     185                    if (selected instanceof MoveImgDisplayPanel) {
     186                        ((MoveImgDisplayPanel<?>) selected).fireModelUpdate();
     187                    }
     188                }));
     189            }});
    186190    }
    187191
Note: See TracChangeset for help on using the changeset viewer.