Really fix deadlock(tm) (try running some items through EDT, since that is where deadlock happens)

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head v1.3.1
Taylor Smock 2020-02-10 15:43:51 -07:00
rodzic a589db8cfa
commit e9be8a7fc9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -60,8 +60,18 @@ public class CreateConnectionsCommand extends Command {
command.executeCommand();
}
if (undoCommands != null) {
undoCommands.executeCommand();
SwingUtilities.invokeLater(() -> UndoRedoHandler.getInstance().add(undoCommands, false));
try {
SwingUtilities.invokeAndWait(() -> undoCommands.executeCommand());
} catch (InvocationTargetException e) {
undoCommands.executeCommand();
Logging.debug(e);
} catch (InterruptedException e) {
undoCommands.executeCommand();
Logging.debug(e);
Thread.currentThread().interrupt();
} finally {
SwingUtilities.invokeLater(() -> UndoRedoHandler.getInstance().add(undoCommands, false));
}
}
return true;
}