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.
This commit is contained in:
Pieter Wuille 2020-04-06 19:06:29 -07:00 committed by Pieter Wuille
parent 1b151e3ffc
commit 3c61abbbc8

View file

@ -67,8 +67,8 @@ public:
void Clear() void Clear()
{ {
LOCK(m_mutex); LOCK(m_mutex);
for (auto it = m_list.begin(); it != m_list.end();) { for (const auto& entry : m_map) {
it = --it->count ? std::next(it) : m_list.erase(it); if (!--entry.second->count) m_list.erase(entry.second);
} }
m_map.clear(); m_map.clear();
} }