Unverified Commit 3ecdb1c9 authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #843

Fix potential memory leak
parents d8022647 50691c2e
...@@ -231,7 +231,8 @@ public: ...@@ -231,7 +231,8 @@ public:
/// Adds a hook type to the scheduler. /// Adds a hook type to the scheduler.
template <class Hook, class... Ts> template <class Hook, class... Ts>
actor_system_config& add_thread_hook(Ts&&... ts) { actor_system_config& add_thread_hook(Ts&&... ts) {
thread_hooks_.emplace_back(new Hook(std::forward<Ts>(ts)...)); std::unique_ptr<thread_hook> hook{new Hook(std::forward<Ts>(ts)...)};
thread_hooks_.emplace_back(std::move(hook));
return *this; return *this;
} }
......
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