Unverified Commit e67686d7 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #1282

Properly clear the registry on shutdown
parents 76a31e23 f1d99028
...@@ -11,6 +11,9 @@ is based on [Keep a Changelog](https://keepachangelog.com). ...@@ -11,6 +11,9 @@ is based on [Keep a Changelog](https://keepachangelog.com).
encountering `SSL_ERROR_WANT_READ`. The crash manifested if CAF resumed a encountering `SSL_ERROR_WANT_READ`. The crash manifested if CAF resumed a
write operation but failed to fully reset its state. The state management (and write operation but failed to fully reset its state. The state management (and
consequently the crash) has been fixed. consequently the crash) has been fixed.
- CAF now clears the actor registry before calling the destructors of loaded
modules. This fixes undefined behavior that could occur in rare cases where
actor cleanup code could run after loaded modules had been destroyed.
## [0.18.4] - 2021-07-07 ## [0.18.4] - 2021-07-07
......
...@@ -148,7 +148,14 @@ void actor_registry::start() { ...@@ -148,7 +148,14 @@ void actor_registry::start() {
} }
void actor_registry::stop() { void actor_registry::stop() {
// nop {
exclusive_guard guard{instances_mtx_};
entries_.clear();
}
{
exclusive_guard guard{named_entries_mtx_};
named_entries_.clear();
}
} }
} // namespace caf } // namespace caf
...@@ -384,8 +384,6 @@ actor_system::~actor_system() { ...@@ -384,8 +384,6 @@ actor_system::~actor_system() {
}; };
drop(spawn_serv_); drop(spawn_serv_);
drop(config_serv_); drop(config_serv_);
registry_.erase("SpawnServ");
registry_.erase("ConfigServ");
// group module is the first one, relies on MM // group module is the first one, relies on MM
groups_.stop(); groups_.stop();
// stop modules in reverse order // stop modules in reverse order
......
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