Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[code] allow s4u::Mailbox::setReceiver(nullptr)
authorMillian Poquet <millian.poquet@inria.fr>
Tue, 27 Feb 2018 12:56:24 +0000 (13:56 +0100)
committerMillian Poquet <millian.poquet@inria.fr>
Tue, 27 Feb 2018 12:56:24 +0000 (13:56 +0100)
src/kernel/activity/MailboxImpl.cpp

index bed10c2..8a68981 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