aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-04-06 19:06:29 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2020-04-07 12:53:40 -0700
commit3c61abbbc847d725f30d169278d84655571407c1 (patch)
treeaddf0aeae4621a4aa0ff06898afe76317151493f /src
parent1b151e3ffce7c1a2ee46bf280cc1d96775d1f91e (diff)
Do not clear validationinterface entries being executed
The previous code for MainSignalsInstance::Clear would decrement the reference count of every interface, including ones that were already Unregister()ed but still being executed.
Diffstat (limited to 'src')
-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();
}