summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2021-06-22 04:27:44 -0300
committerGravatar Rodrigo Locatti2021-06-22 04:27:44 -0300
commit1ca9a13e507ae5ba7c23b510b2dae0ab26d501fd (patch)
treee46ac457f8c36a815f2035398387f60f11149397
parentMerge pull request #6499 from FernandoS27/we-were-on-a-break (diff)
downloadyuzu-1ca9a13e507ae5ba7c23b510b2dae0ab26d501fd.tar.gz
yuzu-1ca9a13e507ae5ba7c23b510b2dae0ab26d501fd.tar.xz
yuzu-1ca9a13e507ae5ba7c23b510b2dae0ab26d501fd.zip
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.
-rw-r--r--src/common/detached_tasks.cpp2
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() {
21} 21}
22 22
23DetachedTasks::~DetachedTasks() { 23DetachedTasks::~DetachedTasks() {
24 WaitForAllTasks();
25
24 std::unique_lock lock{mutex}; 26 std::unique_lock lock{mutex};
25 ASSERT(count == 0); 27 ASSERT(count == 0);
26 instance = nullptr; 28 instance = nullptr;