summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug/MemoryPatches.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Debug/MemoryPatches.cpp')
-rw-r--r--Source/Core/Common/Debug/MemoryPatches.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/Common/Debug/MemoryPatches.cpp b/Source/Core/Common/Debug/MemoryPatches.cpp
index 43ed9efd49..8dd9b5716d 100644
--- a/Source/Core/Common/Debug/MemoryPatches.cpp
+++ b/Source/Core/Common/Debug/MemoryPatches.cpp
@@ -32,6 +32,7 @@ void MemoryPatches::SetPatch(u32 address, u32 value)
void MemoryPatches::SetPatch(u32 address, std::vector<u8> value)
{
+ UnsetPatch(address);
const std::size_t index = m_patches.size();
m_patches.emplace_back(address, std::move(value));
Patch(index);
@@ -45,7 +46,7 @@ const std::vector<MemoryPatch>& MemoryPatches::GetPatches() const
void MemoryPatches::UnsetPatch(u32 address)
{
const auto it = std::find_if(m_patches.begin(), m_patches.end(),
- [address](const auto& patch) { return patch.address == address; });
+ [address](const auto& patch) { return patch.address == address; });
if (it == m_patches.end())
return;