Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a memleak
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 20 Jan 2017 10:53:21 +0000 (11:53 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 20 Jan 2017 10:53:27 +0000 (11:53 +0100)
This one is vicious and I should cleanup the VM and Host interactions.
one day.

src/surf/HostImpl.cpp

index cf09097..cd491cc 100644 (file)
@@ -93,6 +93,8 @@ Action* HostModel::executeParallelTask(int host_nb, simgrid::s4u::Host** host_li
  ************/
 HostImpl::HostImpl(s4u::Host* host) : piface_(host)
 {
+  /* The VM wants to reinstall a new HostImpl, but we don't want to leak the previously existing one */
+  delete piface_->pimpl_;
   piface_->pimpl_ = this;
 }