From 6c4eb2733d8282b347e4ac5c2c2b278e36f48c5f Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 27 Jan 2024 22:53:09 -0500 Subject: kernel: clear pinned waiter list on unpin --- src/core/hle/kernel/k_thread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index 7d3421929..8a360a839 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -543,7 +543,8 @@ void KThread::Unpin() { ASSERT(m_parent != nullptr); // Resume any threads that began waiting on us while we were pinned. - for (auto it = m_pinned_waiter_list.begin(); it != m_pinned_waiter_list.end(); ++it) { + for (auto it = m_pinned_waiter_list.begin(); it != m_pinned_waiter_list.end(); + it = m_pinned_waiter_list.erase(it)) { it->EndWait(ResultSuccess); } } -- cgit v1.2.3