Commit 3673feb6 authored by Dominik Charousset's avatar Dominik Charousset

Fix subtle potential bug in actor destruction

Actors that access the actor system in their cleanup code code, e.g., in
the state destructor of stateful actors, can access an invalid context.
Always accessing the home system instead of retrieving it from the
context fixes this subtle bug.
parent 2cc43777
......@@ -199,8 +199,7 @@ public:
/// Returns the hosting actor system.
inline actor_system& system() const {
CAF_ASSERT(context_);
return context_->system();
return home_system();
}
/// Returns the config of the hosting actor system.
......
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