[ntcore] Release ListenerStorage mutex before stopping thread (#8562)

If the thread is still running then it will deadlock.
Fixes #8561
This commit is contained in:
Dustin Spicuzza
2026-01-11 05:29:49 -05:00
committed by GitHub
parent 67ae589c11
commit 0fd8210b5a

View File

@@ -346,14 +346,16 @@ bool ListenerStorage::WaitForListenerQueue(double timeout) {
} }
void ListenerStorage::Reset() { void ListenerStorage::Reset() {
std::scoped_lock lock{m_mutex}; {
m_pollers.clear(); std::scoped_lock lock{m_mutex};
m_listeners.clear(); m_pollers.clear();
m_connListeners.clear(); m_listeners.clear();
m_topicListeners.clear(); m_connListeners.clear();
m_valueListeners.clear(); m_topicListeners.clear();
m_logListeners.clear(); m_valueListeners.clear();
m_timeSyncListeners.clear(); m_logListeners.clear();
m_timeSyncListeners.clear();
}
m_thread.Join(); m_thread.Join();
} }