Commit a795ff9c authored by Dominik Charousset's avatar Dominik Charousset

Fix expect and allow clauses on terminated actors

parent 00a0d0a5
......@@ -215,11 +215,15 @@ inline caf::mailbox_element* next_mailbox_element(caf_handle x) {
CAF_ASSERT(x.get() != nullptr);
auto sptr = dynamic_cast<caf::scheduled_actor*>(x.get());
if (sptr != nullptr) {
return sptr->mailbox().blocked() ? nullptr : sptr->mailbox().peek();
return sptr->mailbox().closed() || sptr->mailbox().blocked()
? nullptr
: sptr->mailbox().peek();
}
auto bptr = dynamic_cast<caf::blocking_actor*>(x.get());
CAF_ASSERT(bptr != nullptr);
return bptr->mailbox().blocked() ? nullptr : bptr->mailbox().peek();
return bptr->mailbox().closed() || bptr->mailbox().blocked()
? nullptr
: bptr->mailbox().peek();
}
// -- introspection of the next mailbox element --------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment