]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.simulation.sequences/src/org/simantics/simulation/sequences/action/AbstractActionContext.java
No more actions after stopping an action context.
[simantics/platform.git] / bundles / org.simantics.simulation.sequences / src / org / simantics / simulation / sequences / action / AbstractActionContext.java
index 2adb9a045cf8a06fb525124b1a109b73f2163559..1187230ad12f4780914797193e4045ac613810ef 100644 (file)
@@ -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<Function1<Tuple0, Object>> temp = scheduledNow;
@@ -128,6 +131,9 @@ public abstract class AbstractActionContext implements ActionContext {
         synchronized (this) {
             List<Function1<StopReason, Object>> stopFunctions = new ArrayList<>(scheduledWhenStopped);
             scheduledWhenStopped.clear();
+            
+            scheduledNextStep.clear();
+            scheduledAt.clear();
 
             SCLContext context = SCLContext.getCurrent();
             Object oldActionContext = context.put("sequenceAction", this);