From f5780a4f2d6e82616016e5e67dd5db9f994268cf Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Wed, 16 Dec 2020 10:31:17 +0200 Subject: [PATCH] No more actions after stopping an action context. gitlab #659 Change-Id: Ide954c322f682ff7bc9cbc53e8b5130e0294c9ce --- .../simulation/sequences/action/AbstractActionContext.java | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.45.2