Do not free subscriber on last unsubscription

This commit is contained in:
uNetworkingAB
2023-11-01 15:05:13 +01:00
committed by GitHub
parent 20b3ea4685
commit 7da88ce71c
+1 -5
View File
@@ -295,11 +295,7 @@ public:
webSocketContextData->subscriptionHandler(this, topic, newCount, newCount + 1);
}
/* Free us as subscribers if we unsubscribed from our last topic */
if (ok && last) {
webSocketContextData->topicTree->freeSubscriber(webSocketData->subscriber);
webSocketData->subscriber = nullptr;
}
/* Leave us as subscribers even if we subscribe to nothing (last unsubscribed topic might miss its message otherwise) */
return ok;
}