Commit 3627cdb7 authored by Dominik Charousset's avatar Dominik Charousset

Fix exception handling in actor_registry::stop

parent ee447203
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "caf/spawn.hpp" #include "caf/spawn.hpp"
#include "caf/locks.hpp" #include "caf/locks.hpp"
#include "caf/exception.hpp"
#include "caf/actor_cast.hpp" #include "caf/actor_cast.hpp"
#include "caf/attachable.hpp" #include "caf/attachable.hpp"
#include "caf/exit_reason.hpp" #include "caf/exit_reason.hpp"
...@@ -166,6 +167,7 @@ void actor_registry::dispose() { ...@@ -166,6 +167,7 @@ void actor_registry::dispose() {
void actor_registry::stop() { void actor_registry::stop() {
scoped_actor self{true}; scoped_actor self{true};
try {
for (auto& kvp : named_entries_) { for (auto& kvp : named_entries_) {
self->monitor(kvp.second); self->monitor(kvp.second);
self->send_exit(kvp.second, exit_reason::kill); self->send_exit(kvp.second, exit_reason::kill);
...@@ -175,6 +177,10 @@ void actor_registry::stop() { ...@@ -175,6 +177,10 @@ void actor_registry::stop() {
} }
); );
} }
}
catch (actor_exited&) {
CAF_LOG_ERROR("actor_exited thrown in actor_registry::stop");
}
named_entries_.clear(); named_entries_.clear();
} }
......
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