aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/validationinterface.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index c06647cb0d..11000774c0 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -67,8 +67,8 @@ public:
void Clear()
{
LOCK(m_mutex);
- for (auto it = m_list.begin(); it != m_list.end();) {
- it = --it->count ? std::next(it) : m_list.erase(it);
+ for (const auto& entry : m_map) {
+ if (!--entry.second->count) m_list.erase(entry.second);
}
m_map.clear();
}