From: Arnaud Giersch Date: Wed, 27 Sep 2017 08:16:00 +0000 (+0200) Subject: Test comm before cancelation, and kill last leak in this test! \o/ X-Git-Tag: v3_17~72 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4d36514184049d76bf323bdaa53da15b5d1a4c6b Test comm before cancelation, and kill last leak in this test! \o/ --- diff --git a/examples/s4u/dht-chord/s4u-dht-chord.hpp b/examples/s4u/dht-chord/s4u-dht-chord.hpp index a5fff65eb7..50e7f602c3 100644 --- a/examples/s4u/dht-chord/s4u-dht-chord.hpp +++ b/examples/s4u/dht-chord/s4u-dht-chord.hpp @@ -161,9 +161,12 @@ public: } now = simgrid::s4u::Engine::getClock(); } - if (comm_receive != nullptr) - comm_receive->cancel(); - delete static_cast(data); + if (comm_receive != nullptr) { + if (comm_receive->test()) + delete static_cast(data); + else + comm_receive->cancel(); + } // leave the ring leave(); }