Skip to content

Commit

Permalink
replace Plaform.runLater with UserThread.execute to fix concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Dec 18, 2023
1 parent 8f6d473 commit 66756b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,7 @@ public void updateItem(PendingTradesListItem newItem, boolean empty) {
super.updateItem(newItem, empty);
if (!empty && newItem != null) {
trade = newItem.getTrade();
listener = (observable, oldValue, newValue) -> Platform.runLater(new Runnable() {
@Override public void run() {
update();
}
});
listener = (observable, oldValue, newValue) -> UserThread.execute(() -> update());
trade.stateProperty().addListener(listener);
update();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,7 @@ private void updateTimeLeft() {
log.warn("deactivating TradeStepView because model's trade is null");

// schedule deactivation to avoid concurrent modification of clock listeners
Platform.runLater(new Runnable() {
@Override
public void run() {
deactivate();
}
});
UserThread.execute(() -> deactivate());
return;
}

Expand Down

0 comments on commit 66756b2

Please sign in to comment.