From bdfc65d4e7c472344e9c2d7d03cd6470b6bcd2ae Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:05:33 -0800 Subject: [PATCH] [Darwin] MTRDevice _reattemptSubscriptionNowIfNeededWithReason needs to be called while holding lock --- src/darwin/Framework/CHIP/MTRDevice_Concrete.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 19ca96c6d1201f..b2f39837eba14a 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -1072,6 +1072,7 @@ - (void)_triggerResubscribeWithReason:(NSString *)reason nodeLikelyReachable:(BO // The subscription reattempt here eventually asyncs onto the matter queue for session, // and should be called after the above ReleaseSession call, to avoid churn. if (shouldReattemptSubscription) { + std::lock_guard lock(_lock); [self _reattemptSubscriptionNowIfNeededWithReason:reason]; } }