Skip to content

Commit

Permalink
Darwin: Avoid retain cycle with MTRDevice
Browse files Browse the repository at this point in the history
Use the provided reference instead of capturing self.
  • Loading branch information
ksperling-apple committed Mar 28, 2024
1 parent 4e582fc commit 49cf91e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1695,7 +1695,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
*isDuplicate = NO;
*stop = YES;
}];
[workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) {
[workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) {
auto workDone = ^(NSArray<NSDictionary<NSString *, id> *> * _Nullable values, NSError * _Nullable error) {
dispatch_async(queue, ^{
completion(values, error);
Expand Down

0 comments on commit 49cf91e

Please sign in to comment.