From b868873526dcd789810b2056a35a58b5d4d21731 Mon Sep 17 00:00:00 2001 From: wcancino Date: Thu, 5 Feb 2009 10:58:40 +0000 Subject: [PATCH] Deallocate properly buffer when unpack a string message. In fact, the assign function makes its own copy of buffer. So, the buffer is not more necessary: git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1399 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-peo/src/rmc/mpi/mess.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp b/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp index c45f94a6e..c30f56c28 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp +++ b/trunk/paradiseo-peo/src/rmc/mpi/mess.cpp @@ -341,6 +341,7 @@ void unpack (std::string & __str) buffer = new char[len+1]; MPI_Unpack (mpi_buf, MPI_BUF_SIZE, & pos_buf, buffer, len, MPI_CHAR, MPI_COMM_WORLD); __str.assign( buffer ); + delete [] buffer; }