Commit 1aa26ae9d9cfb90c482a2bb4c48e33ef41ad4aa0
1 parent
d122412b
Fix cleaning up subscription tree nodes
Empty leaves weren't removed, causing increase in memory use.
Showing
1 changed file
with
3 additions
and
2 deletions
subscriptionstore.cpp
| @@ -443,9 +443,10 @@ int SubscriptionNode::cleanSubscriptions() | @@ -443,9 +443,10 @@ int SubscriptionNode::cleanSubscriptions() | ||
| 443 | auto childrenIt = children.begin(); | 443 | auto childrenIt = children.begin(); |
| 444 | while(childrenIt != children.end()) | 444 | while(childrenIt != children.end()) |
| 445 | { | 445 | { |
| 446 | - subscribersLeftInChildren += childrenIt->second->cleanSubscriptions(); | 446 | + int n = childrenIt->second->cleanSubscriptions(); |
| 447 | + subscribersLeftInChildren += n; | ||
| 447 | 448 | ||
| 448 | - if (subscribersLeftInChildren > 0) | 449 | + if (n > 0) |
| 449 | childrenIt++; | 450 | childrenIt++; |
| 450 | else | 451 | else |
| 451 | { | 452 | { |