From 49cf91e49915647d41b1fa39b7b45753cdbe178d Mon Sep 17 00:00:00 2001 From: Karsten Sperling Date: Thu, 28 Mar 2024 17:36:57 +1300 Subject: [PATCH] Darwin: Avoid retain cycle with MTRDevice Use the provided reference instead of capturing self. --- src/darwin/Framework/CHIP/MTRDevice.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 777265e31d88d7..36ce2462c43000 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -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 *> * _Nullable values, NSError * _Nullable error) { dispatch_async(queue, ^{ completion(values, error);