From: Millian Poquet Date: Tue, 27 Feb 2018 12:56:24 +0000 (+0100) Subject: [code] allow s4u::Mailbox::setReceiver(nullptr) X-Git-Tag: v3.19~177 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/eb3b33df5b52a1aadfeaaf21545ff4340ce3f68a?hp=37147380a9b22e9a31427859eed2def0bb2c3d74 [code] allow s4u::Mailbox::setReceiver(nullptr) --- diff --git a/src/kernel/activity/MailboxImpl.cpp b/src/kernel/activity/MailboxImpl.cpp index bed10c21be..8a68981583 100644 --- a/src/kernel/activity/MailboxImpl.cpp +++ b/src/kernel/activity/MailboxImpl.cpp @@ -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