File tree 2 files changed +7
-10
lines changed
src/darwin/Framework/CHIP
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 73
73
static bool sExitHandlerRegistered = false ;
74
74
static void ShutdownOnExit ()
75
75
{
76
- // Depending on the structure of the software, this code might execute *after* the main autorelease pool has exited.
77
- // Therefore, it needs to be enclosed in its own autorelease pool.
78
- @autoreleasepool {
79
- MTR_LOG (" ShutdownOnExit invoked on exit" );
80
- [[MTRDeviceControllerFactory sharedInstance ] stopControllerFactory ];
81
- }
76
+ // Don't do anything here, period
82
77
}
83
78
84
79
@interface MTRDeviceControllerFactoryParams ()
@@ -441,8 +436,8 @@ - (void)stopControllerFactory
441
436
{
442
437
[self _assertCurrentQueueIsNotMatterQueue ];
443
438
444
- while ( [_controllers count ] != 0 ) {
445
- [_controllers[ 0 ] shutdown ];
439
+ for (MTRDeviceController * controller in [_controllers copy ] ) {
440
+ [controller shutdown ];
446
441
}
447
442
448
443
dispatch_sync (_chipWorkQueue, ^{
Original file line number Diff line number Diff line change @@ -250,7 +250,8 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
250
250
251
251
@try {
252
252
[[xpcConnection remoteObjectProxyWithErrorHandler: ^(NSError * _Nonnull error) {
253
- MTR_LOG_ERROR (" Error: %@" , error);
253
+ MTR_LOG_ERROR (" Invoke error: %@" , error);
254
+ completion (nil , [NSError errorWithDomain: MTRErrorDomain code: MTRErrorCodeGeneralError userInfo: nil ]);
254
255
}] deviceController: [[self deviceController ] uniqueIdentifier ]
255
256
nodeID: [self nodeID ]
256
257
invokeCommandWithEndpointID: endpointID
@@ -263,7 +264,8 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
263
264
serverSideProcessingTimeout: serverSideProcessingTimeout
264
265
completion: completion];
265
266
} @catch (NSException * exception ) {
266
- MTR_LOG_ERROR (" Exception sending XPC messsage: %@" , exception );
267
+ MTR_LOG_ERROR (" Exception sending XPC message: %@" , exception );
268
+ completion (nil , [NSError errorWithDomain: MTRErrorDomain code: MTRErrorCodeGeneralError userInfo: nil ]);
267
269
}
268
270
}
269
271
You can’t perform that action at this time.
0 commit comments