diff --git a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm index 229d95d9206bc1..80ad6f80d5be2b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm @@ -271,8 +271,11 @@ - (void)_stopMonitoring - (void)stopMonitoring { - MTR_LOG_INFO("%@ stop connectivity monitoring for %@", self, _instanceName); - std::lock_guard lock(sConnectivityMonitorLock); - [self _stopMonitoring]; + // DNSServiceRefDeallocate must be called on the same queue set on the shared connection. + dispatch_async(sSharedResolverQueue, ^{ + MTR_LOG_INFO("%@ stop connectivity monitoring for %@", self, self->_instanceName); + std::lock_guard lock(sConnectivityMonitorLock); + [self _stopMonitoring]; + }); } @end