mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 04:12:36 -03:00
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:
parent
1b151e3ffc
commit
3c61abbbc8
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue