Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpi_replay: allow to register extra events before things start (+plug a memleak)
[simgrid.git] / src / xbt / xbt_replay.cpp
index 50f208a..d0b7197 100644 (file)
@@ -109,6 +109,9 @@ void xbt_replay_reader_free(xbt_replay_reader_t *reader)
  */
 void xbt_replay_action_register(const char *action_name, action_fun function)
 {
+  if (xbt_action_funs == nullptr) // If the user registers a function before the start
+    _xbt_replay_action_init();
+
   char* lowername = str_tolower (action_name);
   xbt_dict_set(xbt_action_funs, lowername, (void*) function, nullptr);
   xbt_free(lowername);
@@ -233,7 +236,7 @@ static char **action_get_action(char *name)
         xbt_dynar_push(otherqueue, &evt);
       }
     }
-    goto todo_done;             // end of file reached while searching in vain for more work
+    // end of file reached while searching in vain for more work
   } else {
     // Get something from my queue and return it
     xbt_dynar_shift(myqueue, &evt);