Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix incorrect iterator usage in BreakPoints::Clear
  • Loading branch information
jordan-woyak committed Jan 8, 2013
1 parent b4717ca commit baa29f5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Source/Core/Common/Src/BreakPoints.cpp
Expand Up @@ -19,7 +19,9 @@
#include "DebugInterface.h"
#include "BreakPoints.h"
#include "../../Core/Src/PowerPC/JitCommon/JitBase.h"

#include <sstream>
#include <algorithm>

bool BreakPoints::IsAddressBreakPoint(u32 _iAddress)
{
Expand Down Expand Up @@ -110,12 +112,17 @@ void BreakPoints::Remove(u32 em_address)

void BreakPoints::Clear()
{
for (TBreakPoints::iterator i = m_BreakPoints.begin(); i != m_BreakPoints.end(); ++i)
if (jit)
{
if (jit)
jit->GetBlockCache()->InvalidateICache(i->iAddress, 4);
m_BreakPoints.erase(i);
std::for_each(m_BreakPoints.begin(), m_BreakPoints.end(),
[](const TBreakPoint& bp)
{
jit->GetBlockCache()->InvalidateICache(bp.iAddress, 4);
}
);
}

m_BreakPoints.clear();
}

MemChecks::TMemChecksStr MemChecks::GetStrings() const
Expand Down

0 comments on commit baa29f5

Please sign in to comment.