Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix more memory leaks
[simgrid.git] / examples / msg / actions / actions.c
index 7e21014..4542163 100644 (file)
@@ -129,8 +129,7 @@ static void action_recv(xbt_dynar_t action)
   char mailbox_name[250];
   m_task_t task = NULL;
   double clock = MSG_get_clock();
-  //FIXME: argument of action ignored so far; semantic not clear
-  //char *from=xbt_dynar_get_as(action,2,char*);
+
   sprintf(mailbox_name, "%s_%s", xbt_dynar_get_as(action, 2, char *),
           MSG_process_get_name(MSG_process_self()));
 
@@ -219,6 +218,7 @@ static void action_wait(xbt_dynar_t action)
   comm = xbt_dynar_pop_as(globals->irecvs,msg_comm_t);
   MSG_comm_wait(comm,-1);
   task = xbt_dynar_pop_as(globals->tasks,m_task_t);
+  MSG_comm_destroy(comm);
   MSG_task_destroy(task);
 
   VERB2("%s %f", name, MSG_get_clock() - clock);
@@ -518,6 +518,8 @@ static void action_finalize(xbt_dynar_t action)
   process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
   if (globals){
     xbt_dynar_free_container(&(globals->isends));
+    xbt_dynar_free_container(&(globals->irecvs));
+    xbt_dynar_free_container(&(globals->tasks));
     free(globals);
   }
 }