diff options
author | Rodrigo Locatti <rodrigo.locatti@gmail.com> | 2021-06-22 04:27:44 -0300 |
---|---|---|
committer | Rodrigo Locatti <rodrigo.locatti@gmail.com> | 2021-06-22 04:27:44 -0300 |
commit | 1ca9a13e507ae5ba7c23b510b2dae0ab26d501fd (patch) | |
tree | e46ac457f8c36a815f2035398387f60f11149397 /src | |
parent | 0485b8e84bacbf7fd56081822faca46114cbeb85 (diff) |
common/detached_tasks: Wait for tasks before shutting down
If this is not waited on, the synchronization primitives are destroyed
whe main exits and the detached task ends up signalling garbage and not
properly finishing.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/detached_tasks.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/detached_tasks.cpp b/src/common/detached_tasks.cpp index f2b4939df..c1362631e 100644 --- a/src/common/detached_tasks.cpp +++ b/src/common/detached_tasks.cpp @@ -21,6 +21,8 @@ void DetachedTasks::WaitForAllTasks() { } DetachedTasks::~DetachedTasks() { + WaitForAllTasks(); + std::unique_lock lock{mutex}; ASSERT(count == 0); instance = nullptr; |