Skip to content

Commit

Permalink
Merge pull request #104 from petebankhead/fix-threading
Browse files Browse the repository at this point in the history
Fix threading bug when image type changes
  • Loading branch information
petebankhead authored Nov 6, 2024
2 parents 24bf7a9 + be85a18 commit 1cacc16
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package qupath.ext.instanseg.ui;

import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.binding.ObjectBinding;
Expand Down Expand Up @@ -341,6 +342,10 @@ private void updateInputChannels(ImageData<BufferedImage> imageData) {
if (imageData == null) {
return;
}
if (!Platform.isFxApplicationThread()) {
Platform.runLater(() -> updateInputChannels(imageData));
return;
}
// Store the checks without changing the current value
inputChannelCache.snapshotChecks();
// Update the items
Expand Down

0 comments on commit 1cacc16

Please sign in to comment.