Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Delete the CPU (fix a mem leak)
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 19 Jan 2016 11:53:31 +0000 (12:53 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 19 Jan 2016 11:59:19 +0000 (12:59 +0100)
include/simgrid/s4u/host.hpp
src/s4u/s4u_host.cpp

index be70679..2f5ef50 100644 (file)
@@ -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;
 
index 8944cba..a21b4d0 100644 (file)
@@ -41,6 +41,7 @@ Host::Host(const char* name)
 }
 
 Host::~Host() {
+       delete pimpl_cpu;
        if (mounts != NULL)
                delete mounts;
 }