diff --git a/app/src/main/cpp/skyline/soc/host1x/syncpoint.cpp b/app/src/main/cpp/skyline/soc/host1x/syncpoint.cpp index 9995c118..b1d79536 100644 --- a/app/src/main/cpp/skyline/soc/host1x/syncpoint.cpp +++ b/app/src/main/cpp/skyline/soc/host1x/syncpoint.cpp @@ -29,9 +29,12 @@ namespace skyline::soc::host1x { // We want to ensure the iterator still exists prior to erasing it // Otherwise, if an invalid iterator was passed in then it could lead to UB // It is important to avoid UB in that case since the deregister isn't called from a locked context - for (auto it{waiters.begin()}; it != waiters.end(); it++) - if (it == waiter) + for (auto it{waiters.begin()}; it != waiters.end(); it++) { + if (it == waiter) { waiters.erase(it); + return; + } + } } u32 Syncpoint::Increment() {