Commit 06ac64da authored by Dominik Charousset's avatar Dominik Charousset

Guard against calling become() when terminated

parent b055e589
...@@ -762,6 +762,10 @@ auto scheduled_actor::reactivate(mailbox_element& x) -> activation_result { ...@@ -762,6 +762,10 @@ auto scheduled_actor::reactivate(mailbox_element& x) -> activation_result {
// -- behavior management ---------------------------------------------------- // -- behavior management ----------------------------------------------------
void scheduled_actor::do_become(behavior bhvr, bool discard_old) { void scheduled_actor::do_become(behavior bhvr, bool discard_old) {
if (getf(is_terminated_flag)) {
CAF_LOG_WARNING("called become() on a terminated actor");
return;
}
if (discard_old && !bhvr_stack_.empty()) if (discard_old && !bhvr_stack_.empty())
bhvr_stack_.pop_back(); bhvr_stack_.pop_back();
// request_timeout simply resets the timeout when it's invalid // request_timeout simply resets the timeout when it's invalid
......
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