From: Frederic Suter Date: Thu, 6 Apr 2017 06:46:36 +0000 (+0200) Subject: plug some leak by delete last message before leaving X-Git-Tag: v3.16~375 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d3d508eff04c525b346d8ad648b6661d2783b827?hp=9d33adbc16791892e7f530e14ac14d6d373c4f0b plug some leak by delete last message before leaving --- diff --git a/examples/s4u/dht-chord/node.cpp b/examples/s4u/dht-chord/node.cpp index 6ce9d5c09c..d8206939bb 100644 --- a/examples/s4u/dht-chord/node.cpp +++ b/examples/s4u/dht-chord/node.cpp @@ -392,7 +392,7 @@ void Node::remoteNotify(int notify_id, int predecessor_candidate_id) simgrid::s4u::this_actor::isend(mailbox, message, 10); } catch (xbt_ex& e) { if (e.category == timeout_error) { - XBT_DEBUG("Send of 'Notify' failed due du an expired timeout on receiver side"); + XBT_DEBUG("Send of 'Notify' failed due to an expired timeout on receiver side"); delete message; } } diff --git a/examples/s4u/dht-chord/s4u_dht-chord.hpp b/examples/s4u/dht-chord/s4u_dht-chord.hpp index 3e7cf06d80..095ea8c480 100644 --- a/examples/s4u/dht-chord/s4u_dht-chord.hpp +++ b/examples/s4u/dht-chord/s4u_dht-chord.hpp @@ -156,7 +156,9 @@ public: } now = simgrid::s4u::Engine::instance()->getClock(); } - + if (data != nullptr) { + delete static_cast(data); + } // leave the ring leave(); }