Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Shutdown Engine first, and fix double-free errors.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 28 Dec 2017 17:38:36 +0000 (18:38 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 28 Dec 2017 17:38:36 +0000 (18:38 +0100)
src/surf/surf_interface.cpp

index 5960575..02dfd42 100644 (file)
@@ -321,6 +321,7 @@ void surf_exit()
 {
   TRACE_end();                  /* Just in case it was not called by the upper layer (or there is no upper layer) */
 
 {
   TRACE_end();                  /* Just in case it was not called by the upper layer (or there is no upper layer) */
 
+  simgrid::s4u::Engine::shutdown();
   sg_link_exit();
   for (auto const& e : storage_types) {
     simgrid::surf::StorageType* stype = e.second;
   sg_link_exit();
   for (auto const& e : storage_types) {
     simgrid::surf::StorageType* stype = e.second;
@@ -345,7 +346,6 @@ void surf_exit()
 
   tmgr_finalize();
   sg_platf_exit();
 
   tmgr_finalize();
   sg_platf_exit();
-  simgrid::s4u::Engine::shutdown();
 
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }
 
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }