From 771fa943dc772541f62f6454720690290bb017e1 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sat, 15 Oct 2016 18:51:49 +0100 Subject: [PATCH] BreakPoints: ClearAllTemporary uses valid iterators --- Source/Core/Common/BreakPoints.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/BreakPoints.cpp b/Source/Core/Common/BreakPoints.cpp index 19ae887d55..633622aa6d 100644 --- a/Source/Core/Common/BreakPoints.cpp +++ b/Source/Core/Common/BreakPoints.cpp @@ -115,13 +115,18 @@ void BreakPoints::Clear() void BreakPoints::ClearAllTemporary() { - for (const TBreakPoint& bp : m_BreakPoints) + auto bp = m_BreakPoints.begin(); + while (bp != m_BreakPoints.end()) { - if (bp.bTemporary) + if (bp->bTemporary) { if (jit) - jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4, true); - Remove(bp.iAddress); + jit->GetBlockCache()->InvalidateICache(bp->iAddress, 4, true); + bp = m_BreakPoints.erase(bp); + } + else + { + ++bp; } } }