pl.release ();
}
- if (_session && _running && stop_engine &&
+ const bool was_running_will_stop = (_running && stop_engine);
+
+ if (was_running_will_stop) {
+ _running = false;
+ }
+
+ if (_session && was_running_will_stop &&
(_session->state_of_the_state() & Session::Loading) == 0 &&
(_session->state_of_the_state() & Session::Deletion) == 0) {
// it's not a halt, but should be handled the same way:
_session->engine_halted ();
}
- if (stop_engine && _running) {
- _running = false;
+ if (was_running_will_stop) {
if (!for_latency) {
_started_for_latency = false;
} else if (!_started_for_latency) {