Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix
[simgrid.git] / src / s4u / s4u_engine.cpp
index b872ca4..7c23adc 100644 (file)
@@ -23,7 +23,9 @@ XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 
 namespace simgrid {
 namespace s4u {
-xbt::signal<void(void)> onPlatformCreated;
+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. */
 
@@ -96,12 +98,14 @@ static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* n
     return current;
 
   xbt_dict_cursor_t cursor = nullptr;
-  char *key;
-  NetZone_t elem;
+  charkey;
+  s4u::NetZone* 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;
 }
@@ -135,7 +139,7 @@ void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
 /** @brief Unregister a given netpoint */
 void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
 {
-  simgrid::simix::kernelImmediate([&] {
+  simgrid::simix::kernelImmediate([this, point] {
     pimpl->netpoints_.erase(point->name());
     delete point;
   });