diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 8c90fccf145ee4..1a6e7939c5b702 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -392,21 +392,7 @@ void SessionManager::ReleaseSessionsForFabricExceptOne(FabricIndex fabricIndex, mSecureSessions.ForEachSession([&](auto session) { if (session->GetPeer().GetFabricIndex() == fabricIndex) { - if (session == exception->AsSecureSession()) - session->MarkForInactive(); - else - session->MarkForRemoval(); - } - return Loop::Continue; - }); -} - -void SessionManager::ReleaseSessionForNodeExceptOne(const ScopedNodeId & node, const SessionHandle & exception) -{ - mSecureSessions.ForEachSession([&](auto session) { - if (session->GetPeer() == node) - { - if (session == exception->AsSecureSession()) + if (session == deferred->AsSecureSession()) session->MarkForInactive(); else session->MarkForRemoval();