Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug two memleaks
[simgrid.git] / src / simix / smx_global.cpp
index 35c9c0a..dfcf0ba 100644 (file)
@@ -302,6 +302,9 @@ void SIMIX_clean()
 
   xbt_os_mutex_destroy(simix_global->mutex);
   simix_global->mutex = nullptr;
+#if HAVE_MC
+  xbt_dynar_free(&simix_global->actors_vector);
+#endif
 
   /* Let's free maestro now */
   delete simix_global->maestro_process->context;
@@ -693,5 +696,6 @@ void SIMIX_display_process_status()
 
 int SIMIX_is_maestro()
 {
-  return simix_global==nullptr /*SimDag*/|| SIMIX_process_self() == simix_global->maestro_process;
+  smx_actor_t self = SIMIX_process_self();
+  return simix_global == nullptr /*SimDag*/ || self == nullptr || self == simix_global->maestro_process;
 }