mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01: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:
committed by
Pieter Wuille
parent
1b151e3ffc
commit
3c61abbbc8
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user