Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a memleak. I should beter kill that XBT container instead
[simgrid.git] / src / s4u / s4u_engine.cpp
index a39f436..0fc822e 100644 (file)
@@ -25,6 +25,7 @@ namespace simgrid {
 namespace s4u {
 xbt::signal<void()> onPlatformCreated;
 xbt::signal<void()> onSimulationEnd;
+xbt::signal<void(double)> onTimeAdvance;
 
 Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
 
@@ -101,8 +102,10 @@ static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* n
   NetZone_t elem;
   xbt_dict_foreach(current->children(), cursor, key, elem) {
     simgrid::s4u::NetZone* tmp = netzoneByNameRecursive(elem, name);
-    if (tmp != nullptr )
-        return tmp;
+    if (tmp != nullptr) {
+      xbt_dict_cursor_free(&cursor);
+      return tmp;
+    }
   }
   return nullptr;
 }