Fix incorrect iterator usage in BreakPoints::Clear

This commit is contained in:
Jordan Woyak 2013-01-08 15:02:50 -06:00
parent b4717ca802
commit baa29f571c
1 changed files with 11 additions and 4 deletions

View File

@ -19,7 +19,9 @@
#include "DebugInterface.h" #include "DebugInterface.h"
#include "BreakPoints.h" #include "BreakPoints.h"
#include "../../Core/Src/PowerPC/JitCommon/JitBase.h" #include "../../Core/Src/PowerPC/JitCommon/JitBase.h"
#include <sstream> #include <sstream>
#include <algorithm>
bool BreakPoints::IsAddressBreakPoint(u32 _iAddress) bool BreakPoints::IsAddressBreakPoint(u32 _iAddress)
{ {
@ -110,12 +112,17 @@ void BreakPoints::Remove(u32 em_address)
void BreakPoints::Clear() void BreakPoints::Clear()
{ {
for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i) if (jit)
{ {
if (jit) std::for_each(m_BreakPoints.begin(), m_BreakPoints.end(),
jit->GetBlockCache()->InvalidateICache(i->iAddress, 4); [](const TBreakPoint& bp)
m_BreakPoints.erase(i); {
jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4);
}
);
} }
m_BreakPoints.clear();
} }
MemChecks::TMemChecksStr MemChecks::GetStrings() const MemChecks::TMemChecksStr MemChecks::GetStrings() const