Skip to content

Commit 7d3716c

Browse files
committed
Fix slider deadlock. Fixes #314.
1 parent 3fb61ee commit 7d3716c

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/control/ControlPanelMediator.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ private void filterNodesAndEdges(EMViewControlPanel viewPanel, EnrichmentMap map
792792
timer.stop();
793793
}
794794

795-
timer.setInitialDelay(250);
795+
timer.setInitialDelay(350);
796796
timer.start();
797797
}
798798

@@ -899,7 +899,6 @@ private class FilterActionListener implements ActionListener {
899899
private FilterNodesEdgesTask task;
900900

901901
private boolean cancelled;
902-
private Object lock = new Object();
903902

904903
public FilterActionListener(EMViewControlPanel viewPanel, EnrichmentMap map, CyNetworkView netView) {
905904
this.viewPanel = viewPanel;
@@ -934,24 +933,21 @@ public void taskFinished(ObservableTask task) {
934933

935934
@Override
936935
public void allFinished(FinishStatus finishStatus) {
937-
synchronized (lock) {
938-
task = null;
939-
940-
if (!cancelled)
941-
netView.updateView();
942-
}
936+
task = null;
937+
if (!cancelled)
938+
netView.updateView();
943939
}
944940
});
945941
}
946942

947943
public void cancel() {
948944
cancelled = true;
949945

950-
synchronized (lock) {
951-
if (task != null) {
946+
if (task != null) {
947+
try {
952948
task.cancel();
953949
task = null;
954-
}
950+
} catch(NullPointerException e) {}
955951
}
956952
}
957953

0 commit comments

Comments
 (0)