Skip to content

Commit 70d9a61

Browse files
authored
[Darwin] Fix MTRDeviceConnectivityMonitor DNSServiceRefDeallocate call on the correct queue (#33410)
1 parent f075b9b commit 70d9a61

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm

+6-3
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,11 @@ - (void)_stopMonitoring
271271

272272
- (void)stopMonitoring
273273
{
274-
MTR_LOG_INFO("%@ stop connectivity monitoring for %@", self, _instanceName);
275-
std::lock_guard lock(sConnectivityMonitorLock);
276-
[self _stopMonitoring];
274+
// DNSServiceRefDeallocate must be called on the same queue set on the shared connection.
275+
dispatch_async(sSharedResolverQueue, ^{
276+
MTR_LOG_INFO("%@ stop connectivity monitoring for %@", self, self->_instanceName);
277+
std::lock_guard lock(sConnectivityMonitorLock);
278+
[self _stopMonitoring];
279+
});
277280
}
278281
@end

0 commit comments

Comments
 (0)