From: Reino Ruusu Date: Wed, 16 Dec 2020 08:31:17 +0000 (+0200) Subject: No more actions after stopping an action context. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F4627%2F2;p=simantics%2Fplatform.git No more actions after stopping an action context. gitlab #659 Change-Id: Ide954c322f682ff7bc9cbc53e8b5130e0294c9ce --- diff --git a/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java b/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java index 2adb9a045..1187230ad 100644 --- a/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java +++ b/bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java @@ -82,6 +82,9 @@ public abstract class AbstractActionContext implements ActionContext { public double handleStep(double currentTime) { synchronized (this) { + if (stopped) + return Double.POSITIVE_INFINITY; + this.currentTime = currentTime; { ArrayList> temp = scheduledNow; @@ -128,6 +131,9 @@ public abstract class AbstractActionContext implements ActionContext { synchronized (this) { List> stopFunctions = new ArrayList<>(scheduledWhenStopped); scheduledWhenStopped.clear(); + + scheduledNextStep.clear(); + scheduledAt.clear(); SCLContext context = SCLContext.getCurrent(); Object oldActionContext = context.put("sequenceAction", this);