You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 07:34:51 UTC

svn commit: r1131799 - /incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp

Author: benh
Date: Sun Jun  5 05:34:51 2011
New Revision: 1131799

URL: http://svn.apache.org/viewvc?rev=1131799&view=rev
Log:
Fixed possible memory leak in ReliableProcess.

Modified:
    incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp

Modified: incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp?rev=1131799&r1=1131798&r2=1131799&view=diff
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp (original)
+++ incubator/mesos/trunk/src/third_party/libprocess/reliable.cpp Sun Jun  5 05:34:51 2011
@@ -76,6 +76,14 @@ ReliableProcess::~ReliableProcess()
     free(current);
     current = NULL;
   }
+
+  foreachpair (const PID &pid, ReliableSender *sender, senders) {
+    assert(pid == sender->getPID());
+    // Shut it down by sending it an ack.
+    send(pid, RELIABLE_ACK);
+    wait(pid);
+    delete sender;
+  }
 }