diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index dc158c89f768ec..0ae15d02002d9e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -237,6 +237,10 @@ - (void)invalidate _weakDelegate = nil; + // Make sure we don't try to resubscribe if we have a pending resubscribe + // attempt, since we now have no delegate. + _reattemptingSubscription = NO; + os_unfair_lock_unlock(&self->_lock); } @@ -336,7 +340,8 @@ - (void)_handleSubscriptionReset // if there is no delegate then also do not retry id delegate = _weakDelegate.strongObject; if (!delegate) { - MTR_LOG_DEFAULT("%@ no delegate - do not reattempt subscription", self); + // NOTE: Do not log anythig here: we have been invalidated, and the + // Matter stack might already be torn down. os_unfair_lock_unlock(&self->_lock); return; }