Commit 71d69433 authored by Xavier Thompson's avatar Xavier Thompson

worker.hpp: Free memory on destruction

parent 868051fe
...@@ -48,6 +48,18 @@ namespace typon ...@@ -48,6 +48,18 @@ namespace typon
std::atomic<WorkDeque *> _active {nullptr}; std::atomic<WorkDeque *> _active {nullptr};
std::vector<WorkDeque *> _pool; std::vector<WorkDeque *> _pool;
~Worker()
{
for (auto & deque : _pool)
{
delete deque;
}
if (auto active = _active.load())
{
delete active;
}
}
void resume(Work & work, fdt::lock_free::gc & gc) noexcept void resume(Work & work, fdt::lock_free::gc & gc) noexcept
{ {
auto active = _active.load(); auto active = _active.load();
......
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