Skip to content

Commit

Permalink
[ntcore] Properly clean up time sync listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Nov 17, 2024
1 parent 0798ac5 commit 378c397
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ntcore/src/main/native/cpp/ListenerStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -384,6 +385,9 @@ ListenerStorage::DoRemoveListeners(std::span<const NT_Listener> handles) {
(listener->eventMask & 0x1ff0000) != 0) {
m_logListeners.Remove(listener.get());
}
if ((listener->eventMask & NT_EVENT_TIMESYNC) != 0) {
m_timeSyncListeners.Remove(listener.get());
}
}
}
return rv;
Expand Down

0 comments on commit 378c397

Please sign in to comment.