From d3d508eff04c525b346d8ad648b6661d2783b827 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Thu, 6 Apr 2017 08:46:36 +0200 Subject: [PATCH] plug some leak by delete last message before leaving --- examples/s4u/dht-chord/node.cpp | 2 +- examples/s4u/dht-chord/s4u_dht-chord.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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(); } -- 2.20.1