Commit c9cc5d42 authored by Dominik Charousset's avatar Dominik Charousset

Add missing demonitor overload

parent c7182118
......@@ -335,6 +335,9 @@ public:
/// Removes a monitor from `whom`.
void demonitor(const actor_addr& whom);
/// Removes a monitor from `whom`.
void demonitor(const strong_actor_ptr& whom);
/// Removes a monitor from `node`.
void demonitor(const node_id& node);
......
......@@ -119,11 +119,15 @@ void local_actor::monitor(const node_id& node) {
void local_actor::demonitor(const actor_addr& whom) {
CAF_LOG_TRACE(CAF_ARG(whom));
auto ptr = actor_cast<strong_actor_ptr>(whom);
if (ptr) {
demonitor(actor_cast<strong_actor_ptr>(whom));
}
void local_actor::demonitor(const strong_actor_ptr& whom) {
CAF_LOG_TRACE(CAF_ARG(whom));
if (whom) {
default_attachable::observe_token tk{address(),
default_attachable::monitor};
ptr->get()->detach(tk);
whom->get()->detach(tk);
}
}
......
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