Skip to content

Commit

Permalink
Do not free subscriber on last unsubscription
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Nov 1, 2023
1 parent 20b3ea4 commit 7da88ce
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/WebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,7 @@ struct WebSocket : AsyncSocket<SSL> {
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;
}
Expand Down

0 comments on commit 7da88ce

Please sign in to comment.