X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7164761a9bba82982c6fd045bd27ccccc0075b15..eb3b33df5b52a1aadfeaaf21545ff4340ce3f68a:/src/kernel/activity/MailboxImpl.cpp diff --git a/src/kernel/activity/MailboxImpl.cpp b/src/kernel/activity/MailboxImpl.cpp index d2f181176f..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 @@ -73,14 +76,14 @@ void MailboxImpl::remove(smx_activity_t activity) boost::static_pointer_cast(activity); xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(), - (comm->mbox ? comm->mbox->name_.c_str() : "(null)"), this->name_.c_str()); + (comm->mbox ? comm->mbox->getCname() : "(null)"), this->getCname()); comm->mbox = nullptr; for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++) if (*it == comm) { this->comm_queue.erase(it); return; } - xbt_die("Comm %p not found in mailbox %s", comm.get(), this->name_.c_str()); + xbt_die("Comm %p not found in mailbox %s", comm.get(), this->getCname()); } } }