Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Suppress trailing whitespaces.
[simgrid.git] / src / kernel / EngineImpl.cpp
index 7dcaf9b..f06eb01 100644 (file)
@@ -185,7 +185,15 @@ EngineImpl::~EngineImpl()
   for (auto const& kv : mailboxes_)
     delete kv.second;
 
-    /* Free the remaining data structures */
+  /* Kill all actors (but maestro) */
+  maestro_->kill_all();
+  run_all_actors();
+  empty_trash();
+
+  delete maestro_;
+  delete context_factory_;
+
+  /* Free the remaining data structures */
 #if SIMGRID_HAVE_MC
   xbt_dynar_free(&actors_vector_);
 #endif
@@ -307,18 +315,6 @@ void EngineImpl::shutdown()
     xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code.");
   }
 
-  /* Kill all actors (but maestro) */
-  instance_->maestro_->kill_all();
-  instance_->run_all_actors();
-  instance_->empty_trash();
-
-  /* Let's free maestro now */
-  delete instance_->maestro_;
-  instance_->maestro_ = nullptr;
-
-  /* Finish context module and SURF */
-  instance_->destroy_context_factory();
-
   while (not timer::kernel_timers().empty()) {
     delete timer::kernel_timers().top().second;
     timer::kernel_timers().pop();
@@ -685,6 +681,7 @@ void EngineImpl::run(double max_date)
 
     if (cfg_breakpoint >= 0.0 && simgrid_get_clock() >= cfg_breakpoint) {
       XBT_DEBUG("Breakpoint reached (%g)", cfg_breakpoint.get());
+      cfg_breakpoint = -1.0; // Let the simulation continue without hiting the breakpoint again and again
 #ifdef SIGTRAP
       std::raise(SIGTRAP);
 #else