From: Gabriel Corona Date: Tue, 19 Jan 2016 11:53:31 +0000 (+0100) Subject: Delete the CPU (fix a mem leak) X-Git-Tag: v3_13~1206 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/232df979b87bc271f4fbb61a2059c6539bc23012?ds=sidebyside Delete the CPU (fix a mem leak) --- diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index be70679e2f..2f5ef50fdc 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -91,6 +91,7 @@ private: public: // FIXME: these should be protected, but it leads to many errors // Use the extensions stuff for this? Go through simgrid::surf::Host? + // TODO, this could be a unique_ptr surf::Cpu *pimpl_cpu = nullptr; surf::NetCard *pimpl_netcard = nullptr; diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 8944cbaa2d..a21b4d01ec 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -41,6 +41,7 @@ Host::Host(const char* name) } Host::~Host() { + delete pimpl_cpu; if (mounts != NULL) delete mounts; }