Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Slightly reorganize log categories; remove unused ones.
[simgrid.git] / src / msg / msg_global.cpp
index 20b55df..9608ac7 100644 (file)
@@ -12,7 +12,6 @@
 #include <xbt/config.hpp>
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
 
 bool MSG_Global_t::debug_multiple_use = false;
 
@@ -42,6 +41,12 @@ void MSG_init_nocheck(int *argc, char **argv) {
     msg_global->sent_msg = 0;
     msg_global->task_copy_callback = nullptr;
     msg_global->process_data_cleanup = nullptr;
+    simgrid::s4u::Actor::on_termination.connect([](simgrid::s4u::Actor const& actor) {
+      // free the data if a function was provided
+      void* userdata = sg_actor_data(&actor);
+      if (userdata && msg_global->process_data_cleanup)
+        msg_global->process_data_cleanup(userdata);
+    });
   }
 
   if(MC_is_active()){