From a2c204f7c114153f92282bf08e48d3c01d2fa655 Mon Sep 17 00:00:00 2001 From: msteinsto <66729213+msteinsto@users.noreply.github.com> Date: Tue, 14 Sep 2021 15:13:35 +0200 Subject: [PATCH] Stopped flag is now set true after simulate_until loop is finished (#656) * Stopped flag is now set true after simulate_until loop is finished * Removed unnecessary space Co-authored-by: MAGSTE --- src/cosim/execution.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cosim/execution.cpp b/src/cosim/execution.cpp index 0eafe34f2..71dbd6232 100644 --- a/src/cosim/execution.cpp +++ b/src/cosim/execution.cpp @@ -152,7 +152,9 @@ class execution::impl stepSize = step(); timer_.sleep(currentTime_); } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); - return !stopped_; + bool isStopped = stopped_; + stopped_ = true; + return !isStopped; }); }