From 232df979b87bc271f4fbb61a2059c6539bc23012 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 19 Jan 2016 12:53:31 +0100 Subject: [PATCH] Delete the CPU (fix a mem leak) --- include/simgrid/s4u/host.hpp | 1 + src/s4u/s4u_host.cpp | 1 + 2 files changed, 2 insertions(+) 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; } -- 2.20.1