Commit 1aa26ae9d9cfb90c482a2bb4c48e33ef41ad4aa0

Authored by Wiebe Cazemier
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 443 auto childrenIt = children.begin();
444 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 450 childrenIt++;
450 451 else
451 452 {
... ...