Skip to content

Commit

Permalink
Dispatch resubscription callback to the right queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored Apr 18, 2023
1 parent d493f31 commit 995d77f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1384,11 +1384,14 @@ - (void)subscribeToAttributePaths:(NSArray<MTRAttributeRequestPath *> * _Nullabl
}
};

auto onResubscriptionScheduledCb = [resubscriptionScheduled](NSError * error, NSNumber * resubscriptionDelay) {
if (resubscriptionScheduled) {
resubscriptionScheduled(error, resubscriptionDelay);
}
};
auto onResubscriptionScheduledCb
= [queue, resubscriptionScheduled](NSError * error, NSNumber * resubscriptionDelay) {
if (resubscriptionScheduled) {
dispatch_async(queue, ^{
resubscriptionScheduled(error, resubscriptionDelay);
});
}
};

MTRReadClientContainer * container = [[MTRReadClientContainer alloc] init];
container.deviceID = self.nodeID;
Expand Down

0 comments on commit 995d77f

Please sign in to comment.