Commit 8ab92007 authored by Dominik Charousset's avatar Dominik Charousset Committed by Dominik Charousset

Cleanup BASP instance when broker shuts down

parent b78cb1a3
......@@ -130,7 +130,9 @@ public:
// -- member variables -------------------------------------------------------
/// Protocol instance of BASP.
union {
basp::instance instance;
};
/// Keeps context information for all open connections.
ctx_map ctx;
......
......@@ -61,9 +61,9 @@ basp_broker::basp_broker(actor_config& cfg)
: super(cfg),
basp::instance::callee(super::system(),
static_cast<proxy_registry::backend&>(*this)),
instance(this, *this),
this_context(nullptr) {
CAF_ASSERT(this_node() != none);
new (&instance) basp::instance(this, *this);
}
basp_broker::~basp_broker() {
......@@ -83,7 +83,10 @@ void basp_broker::on_exit() {
// Make sure all spawn servers are down before clearing the container.
for (auto& kvp : spawn_servers)
anon_send_exit(kvp.second, exit_reason::kill);
// Clear remaining state.
spawn_servers.clear();
monitored_actors.clear();
instance.~instance();
}
const char* basp_broker::name() const {
......
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