Skip to content

Commit b62c978

Browse files
committed
Code cleanup.
1 parent bcc006f commit b62c978

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Messages/SubscriptionHolder.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ public class SubscriptionHolder<TSubscription, TSession>(ILogReceiver logs) : Di
6464
/// <inheritdoc />
6565
protected override void DisposeManaged()
6666
{
67-
base.DisposeManaged();
68-
6967
_rw.Dispose();
68+
69+
base.DisposeManaged();
7070
}
7171

7272
private int _maxTrackedItems = 1000;
@@ -243,7 +243,9 @@ void tryRemove<TKey>(Dictionary<TKey, HashSet<TSubscription>> dict)
243243
tryRemove(_subscriptionsByAllSec);
244244
tryRemove(_subscriptionsBySec);
245245
tryRemove(_subscriptionsByType);
246-
_subscriptionsBySession.Remove(session);
246+
247+
if (_subscriptionsBySession.TryGetAndRemove(session, out var sessionSubs))
248+
subscriptions.AddRange(sessionSubs);
247249

248250
var removeIds = _subscriptionsById.Where(p => p.Value.Session == session).Select(p => p.Key).ToArray();
249251
foreach (var key in removeIds)

0 commit comments

Comments
 (0)