mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 12:15:45 +00:00
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.
This commit is contained in:
parent
3fb11c6e77
commit
ee29cddce2
1 changed files with 2 additions and 0 deletions
|
@ -21,6 +21,8 @@ void DetachedTasks::WaitForAllTasks() {
|
|||
}
|
||||
|
||||
DetachedTasks::~DetachedTasks() {
|
||||
WaitForAllTasks();
|
||||
|
||||
std::unique_lock lock{mutex};
|
||||
ASSERT(count == 0);
|
||||
instance = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue