From 3a1bfadb60d37cd5f2b1a6e1041b2bbcf0c0963f Mon Sep 17 00:00:00 2001 From: adfaure Date: Wed, 17 Aug 2016 15:42:10 +0200 Subject: [PATCH] [s4u]Fix memory leak into s4u::Comm --- src/s4u/s4u_comm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index 9191568766..3d6be869d4 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -110,6 +110,7 @@ void Comm::wait() { } } state_ = finished; + delete this; } void Comm::wait(double timeout) { xbt_assert(state_ == started || state_ == inited); @@ -132,6 +133,7 @@ void Comm::wait(double timeout) { userData_, timeout, rate_); } state_ = finished; + delete this; } s4u::Comm &Comm::send_async(MailboxPtr dest, void *data, int simulatedSize) { @@ -162,6 +164,7 @@ bool Comm::test() { if(simcall_comm_test(pimpl_)){ state_ = finished; + delete this; return true; } return false; -- 2.20.1