Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Plug memory leak.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 8 May 2023 19:27:14 +0000 (21:27 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 8 May 2023 19:27:52 +0000 (21:27 +0200)
examples/cpp/operation-switch-host/s4u-operation-switch-host.cpp

index fe52596..10b0b4c 100644 (file)
@@ -54,7 +54,8 @@ int main(int argc, char* argv[])
   // Add a function to be called before each executions of comm0
   // This function modifies the graph of operations by adding or removing
   // successors to comm0
-  comm0->on_this_start([comm0, exec1, exec2, jupiter, fafard](const simgrid::plugins::Operation*) {
+  comm0->on_this_start([exec1, exec2, jupiter, fafard](simgrid::plugins::Operation* op) {
+    auto* comm0      = dynamic_cast<simgrid::plugins::CommOp*>(op);
     static int count = 0;
     if (count % 2 == 0) {
       comm0->set_destination(jupiter);