Skip to content

Commit 326c61c

Browse files
author
taylor.smock
committed
Fix #23078: Freeze on conflict resolution after upload
git-svn-id: https://josm.openstreetmap.de/svn/trunk@18778 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 4f48049 commit 326c61c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,27 @@ public PopupMenuHandler getPopupMenuHandler() {
195195
* Launches a conflict resolution dialog for the first selected conflict
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;
205207
}
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);
214221
} else {

0 commit comments

Comments
 (0)