Changeset 18778 in josm for trunk/src/org


Ignore:
Timestamp:
2023-07-25T00:19:11+02:00 (15 months ago)
Author:
taylor.smock
Message:

Fix #23079: Freeze on conflict resolution after upload

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r17524 r18778  
    196196     */
    197197    private void resolve() {
     198        final ConflictResolutionDialog dialog;
     199        int index;
    198200        synchronized (this) {
    199201            if (conflicts == null || model.getSize() == 0)
    200202                return;
    201203
    202             int index = lstConflicts.getSelectedIndex();
     204            index = lstConflicts.getSelectedIndex();
    203205            if (index < 0) {
    204206                index = 0;
     
    206208
    207209            Conflict<? extends OsmPrimitive> c = conflicts.get(index);
    208             ConflictResolutionDialog dialog = new ConflictResolutionDialog(MainApplication.getMainFrame());
     210            dialog = new ConflictResolutionDialog(MainApplication.getMainFrame());
    209211            dialog.getConflictResolver().populate(c);
    210             dialog.showDialog();
    211 
     212        }
     213        // This must not be synchronized. See #23079.
     214        // On macOS, under some instances, the AppKit thread may want to lock this (`ConflictDialog`) in order to add a
     215        // property change listener. This dialog currently locks the UI thread, so it *should* be safe to have outside
     216        // of the synchronized lock.
     217        dialog.showDialog();
     218        synchronized (this) {
    212219            if (index < conflicts.size() - 1) {
    213220                lstConflicts.setSelectedIndex(index);
Note: See TracChangeset for help on using the changeset viewer.