X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2c0aa88e3d941e79fc79d39e3e58224d282b76d3..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp?ds=sidebyside diff --git a/examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp b/examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp index 7dd386058f..d907daa565 100644 --- a/examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp +++ b/examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -67,9 +67,8 @@ public: { double compute_cost; do { - const auto* msg = static_cast(mailbox->get()); + auto msg = mailbox->get_unique(); compute_cost = *msg; - delete msg; if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */ simgrid::s4u::this_actor::execute(compute_cost);