Skip to content

Commit 3c61abb

Browse files
committed
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.
1 parent 1b151e3 commit 3c61abb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/validationinterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ struct MainSignalsInstance {
6767
void Clear()
6868
{
6969
LOCK(m_mutex);
70-
for (auto it = m_list.begin(); it != m_list.end();) {
71-
it = --it->count ? std::next(it) : m_list.erase(it);
70+
for (const auto& entry : m_map) {
71+
if (!--entry.second->count) m_list.erase(entry.second);
7272
}
7373
m_map.clear();
7474
}

0 commit comments

Comments
 (0)