Skip to content

Commit

Permalink
Clear outgoingMessages on last drained subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB authored Sep 28, 2021
1 parent 182ca20 commit 814a7ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TopicTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ struct TopicTree {
/* This one always resets needsDrainage before it calls any cb's.
* Otherwise we would stackoverflow when sending after publish but before drain. */
drainImpl(s);

/* If we drained last subscriber, also clear outgoingMessages */
if (!drainableSubscribers) {
outgoingMessages.clear();
}
}
}

Expand Down

0 comments on commit 814a7ee

Please sign in to comment.