diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 23aaf9d85d03be..a86dd4b98aed9e 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -615,14 +615,14 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest // Walk through all existing subscriptions and shut down those whose subscriber matches // that which just came in. // - mReadHandlers.ForEachActiveObject([this, apExchangeContext](ReadHandler * handler) { + mReadHandlers.ForEachActiveObject([apExchangeContext](ReadHandler * handler) { if (handler->IsFromSubscriber(*apExchangeContext)) { ChipLogProgress(InteractionModel, "Deleting previous subscription from NodeId: " ChipLogFormatX64 ", FabricIndex: %u", ChipLogValueX64(apExchangeContext->GetSessionHandle()->AsSecureSession()->GetPeerNodeId()), apExchangeContext->GetSessionHandle()->GetFabricIndex()); - mReadHandlers.ReleaseObject(handler); + handler->Close(); } return Loop::Continue;