diff options
| author | Pieter Wuille <[email protected]> | 2020-04-06 19:06:29 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2020-04-07 12:53:40 -0700 |
| commit | 3c61abbbc847d725f30d169278d84655571407c1 (patch) | |
| tree | addf0aeae4621a4aa0ff06898afe76317151493f /src/validationinterface.cpp | |
| parent | Merge #18532: rpc: Avoid initialization-order-fiasco on static CRPCCommand ta... (diff) | |
| download | discoin-3c61abbbc847d725f30d169278d84655571407c1.tar.xz discoin-3c61abbbc847d725f30d169278d84655571407c1.zip | |
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/validationinterface.cpp')
| -rw-r--r-- | src/validationinterface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index c06647cb0..11000774c 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(); } |