Skip to content

Commit 3a39c29

Browse files
Darwin: Avoid retain cycle with MTRDevice (project-chip#32767)
Use the provided reference instead of capturing self.
1 parent 0aa859a commit 3a39c29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/darwin/Framework/CHIP/MTRDevice.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
16951695
*isDuplicate = NO;
16961696
*stop = YES;
16971697
}];
1698-
[workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) {
1698+
[workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) {
16991699
auto workDone = ^(NSArray<NSDictionary<NSString *, id> *> * _Nullable values, NSError * _Nullable error) {
17001700
dispatch_async(queue, ^{
17011701
completion(values, error);

0 commit comments

Comments
 (0)