[ntcore] Fix unpublishing on client disconnect (#7042)

This commit is contained in:
Peter Johnson
2024-09-08 10:35:05 -07:00
committed by GitHub
parent cd9922af49
commit 7bdecab729
2 changed files with 72 additions and 0 deletions

View File

@@ -1265,6 +1265,7 @@ void ServerImpl::RemoveClient(int clientId) {
if (tcdIt != topic->clients.end()) {
pubChanged = !tcdIt->second.publishers.empty();
subChanged = !tcdIt->second.subscribers.empty();
topic->publisherCount -= tcdIt->second.publishers.size();
topic->clients.erase(tcdIt);
}