We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cbacbe3 commit 6022500Copy full SHA for 6022500
src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
@@ -73,8 +73,12 @@
73
static bool sExitHandlerRegistered = false;
74
static void ShutdownOnExit()
75
{
76
- MTR_LOG("ShutdownOnExit invoked on exit");
77
- [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory];
+ // Depending on the structure of the software, this code might execute *after* the main autorelease pool has exited.
+ // 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
+ }
82
}
83
84
@interface MTRDeviceControllerFactoryParams ()
0 commit comments