Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[code] allow s4u::Mailbox::setReceiver(nullptr)
[simgrid.git] / src / kernel / activity / MailboxImpl.cpp
index bed10c21beb43f75c898c2ea3ce48e62cd49bc52..8a689815838bd0cf13c7d0caf233d2aba0c57766 100644 (file)
@@ -53,7 +53,10 @@ MailboxImpl* MailboxImpl::byNameOrCreate(const char* name)
  */
 void MailboxImpl::setReceiver(s4u::ActorPtr actor)
 {
-  this->permanent_receiver = actor.get()->getImpl();
+  if (actor != nullptr)
+    this->permanent_receiver = actor.get()->getImpl();
+  else
+    this->permanent_receiver = nullptr;
 }
 /** @brief Pushes a communication activity into a mailbox
  *  @param comm What to add