From: Arnaud Giersch Date: Mon, 8 May 2023 19:27:14 +0000 (+0200) Subject: Plug memory leak. X-Git-Tag: v3.34~131^2~5 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4a21c9a4f3aadcb97911b1e343c0de59c6b921b5 Plug memory leak. --- diff --git a/examples/cpp/operation-switch-host/s4u-operation-switch-host.cpp b/examples/cpp/operation-switch-host/s4u-operation-switch-host.cpp index fe52596f56..10b0b4cd31 100644 --- a/examples/cpp/operation-switch-host/s4u-operation-switch-host.cpp +++ b/examples/cpp/operation-switch-host/s4u-operation-switch-host.cpp @@ -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(op); static int count = 0; if (count % 2 == 0) { comm0->set_destination(jupiter);