Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
easy sonar fixes
[simgrid.git] / src / kernel / EngineImpl.cpp
index 8036e2ec7b33e19d5c6b2db5cf9891cff1c4a4fe..39f49ee81b52a959b1aed62e0e450df72c47ac58 100644 (file)
@@ -453,6 +453,10 @@ void EngineImpl::run_all_actors()
 {
   instance_->get_context_factory()->run_all();
 
+  for (auto const& actor : actors_to_run_)
+    if (actor->context_->to_be_freed())
+      actor->cleanup_from_kernel();
+
   actors_to_run_.swap(actors_that_ran_);
   actors_to_run_.clear();
 }
@@ -693,7 +697,7 @@ void EngineImpl::run(double max_date)
 #else
     xbt_die("MC_is_active() is not supposed to return true in non-MC settings");
 #endif
-    return;
+    THROW_IMPOSSIBLE; // main_loop never returns
   }
 
   if (MC_record_replay_is_active()) {