yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

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:
Rodrigo Locatti 2021-06-22 04:27:44 -03:00
parent 0485b8e84b
commit 1ca9a13e50
1 changed files with 2 additions and 0 deletions

View File

@ -21,6 +21,8 @@ void DetachedTasks::WaitForAllTasks() {
} }
DetachedTasks::~DetachedTasks() { DetachedTasks::~DetachedTasks() {
WaitForAllTasks();
std::unique_lock lock{mutex}; std::unique_lock lock{mutex};
ASSERT(count == 0); ASSERT(count == 0);
instance = nullptr; instance = nullptr;