Do not free subscriber on last unsubscription
This commit is contained in:
+1
-5
@@ -295,11 +295,7 @@ public:
|
|||||||
webSocketContextData->subscriptionHandler(this, topic, newCount, newCount + 1);
|
webSocketContextData->subscriptionHandler(this, topic, newCount, newCount + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free us as subscribers if we unsubscribed from our last topic */
|
/* Leave us as subscribers even if we subscribe to nothing (last unsubscribed topic might miss its message otherwise) */
|
||||||
if (ok && last) {
|
|
||||||
webSocketContextData->topicTree->freeSubscriber(webSocketData->subscriber);
|
|
||||||
webSocketData->subscriber = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user