Commit 49e426b8 authored by Dominik Charousset's avatar Dominik Charousset

Avoid memory leaks during shutdown in basp_broker

parent e4ec7c59
...@@ -44,6 +44,8 @@ namespace io { ...@@ -44,6 +44,8 @@ namespace io {
struct basp_broker_state : actor_namespace::backend, basp::instance::callee { struct basp_broker_state : actor_namespace::backend, basp::instance::callee {
basp_broker_state(broker* self); basp_broker_state(broker* self);
~basp_broker_state();
// inherited from actor_namespace::backend // inherited from actor_namespace::backend
actor_proxy_ptr make_proxy(const node_id& nid, actor_id aid) override; actor_proxy_ptr make_proxy(const node_id& nid, actor_id aid) override;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <limits> #include <limits>
#include "caf/send.hpp"
#include "caf/exception.hpp" #include "caf/exception.hpp"
#include "caf/make_counted.hpp" #include "caf/make_counted.hpp"
#include "caf/event_based_actor.hpp" #include "caf/event_based_actor.hpp"
...@@ -55,6 +56,12 @@ basp_broker_state::basp_broker_state(broker* selfptr) ...@@ -55,6 +56,12 @@ basp_broker_state::basp_broker_state(broker* selfptr)
CAF_ASSERT(this_node() != invalid_node_id); CAF_ASSERT(this_node() != invalid_node_id);
} }
basp_broker_state::~basp_broker_state() {
// make sure all spawn servers are down
for (auto& kvp : spawn_servers)
anon_send_exit(kvp.second, exit_reason::kill);
}
actor_proxy_ptr basp_broker_state::make_proxy(const node_id& nid, actor_proxy_ptr basp_broker_state::make_proxy(const node_id& nid,
actor_id aid) { actor_id aid) {
CAF_LOG_TRACE(CAF_TSARG(nid) << ", " << CAF_ARG(aid)); CAF_LOG_TRACE(CAF_TSARG(nid) << ", " << CAF_ARG(aid));
......
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