X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b82f616359ba02069f0e0f70391a691b9ba91c..458ff11:/src/s4u/s4u_mailbox.cpp diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index d7f48697dc..ed93710d70 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -43,8 +43,9 @@ void Mailbox::setReceiver(Actor* actor) { } /** @brief get the receiver (process associated to the mailbox) */ -Actor& Mailbox::receiver() { - return pimpl_->permanent_receiver->actor(); +ActorPtr Mailbox::receiver() { + if(pimpl_->permanent_receiver == nullptr) return ActorPtr(); + return ActorPtr(&pimpl_->permanent_receiver->actor()); } } @@ -62,5 +63,5 @@ void sg_mbox_setReceiver(sg_mbox_t mbox, smx_process_t process) { mbox->setReceiver(&process->actor()); } smx_process_t sg_mbox_receiver(sg_mbox_t mbox) { - return mbox->receiver().getInferior(); + return mbox->receiver()->getInferior(); }