Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to plug a memleak
[simgrid.git] / src / smpi / internals / smpi_process.cpp
index 17b3812..90a265e 100644 (file)
@@ -23,10 +23,11 @@ using simgrid::s4u::Actor;
 using simgrid::s4u::ActorPtr;
 
 Process::Process(ActorPtr actor, msg_bar_t finalization_barrier)
-  : finalization_barrier_(finalization_barrier)
+    : finalization_barrier_(finalization_barrier), process_(actor)
 {
-  std::stringstream mailboxname, mailboxname_small;
-  process_              = actor;
+  std::stringstream mailboxname;
+  std::stringstream mailboxname_small;
+
   mailboxname           << std::string("SMPI-")  << process_->getPid();
   mailboxname_small     << std::string("small-") << process_->getPid();
   mailbox_              = simgrid::s4u::Mailbox::byName(mailboxname.str());
@@ -76,7 +77,7 @@ void Process::set_data(int* argc, char*** argv)
   argv_ = argv;
   // set the process attached to the mailbox
   mailbox_small_->setReceiver(process_);
-  XBT_DEBUG("<%lu> New process in the game: %p", process_->getPid(), process_);
+  XBT_DEBUG("<%lu> New process in the game: %p", process_->getPid(), process_.get());
 }
 
 /** @brief Prepares the current process for termination. */