diff --git a/ntcore/src/main/native/cpp/ListenerStorage.cpp b/ntcore/src/main/native/cpp/ListenerStorage.cpp index da06d6192e0..be11343de51 100644 --- a/ntcore/src/main/native/cpp/ListenerStorage.cpp +++ b/ntcore/src/main/native/cpp/ListenerStorage.cpp @@ -354,6 +354,7 @@ void ListenerStorage::Reset() { m_topicListeners.clear(); m_valueListeners.clear(); m_logListeners.clear(); + m_timeSyncListeners.clear(); if (m_thread) { m_thread.Stop(); } @@ -384,6 +385,9 @@ ListenerStorage::DoRemoveListeners(std::span handles) { (listener->eventMask & 0x1ff0000) != 0) { m_logListeners.Remove(listener.get()); } + if ((listener->eventMask & NT_EVENT_TIMESYNC) != 0) { + m_timeSyncListeners.Remove(listener.get()); + } } } return rv;