Skip to content

Commit

Permalink
[Darwin] Fix MTRDeviceConnectivityMonitor DNSServiceRefDeallocate cal…
Browse files Browse the repository at this point in the history
…l on the correct queue (#33410)
  • Loading branch information
jtung-apple authored and pull[bot] committed Jul 31, 2024
1 parent f075b9b commit 1008912
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/darwin/Framework/CHIP/MTRDeviceConnectivityMonitor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1008912

Please sign in to comment.