diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 815d7ae2a9f0f6..750ab648cb7bfa 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -70,12 +70,6 @@ using namespace chip::Controller; using namespace chip::Tracing::DarwinFramework; -static bool sExitHandlerRegistered = false; -static void ShutdownOnExit() -{ - // Don't do anything here, period -} - @interface MTRDeviceControllerFactoryParams () // Flag to keep track of whether our .storage is real consumer-provided storage @@ -389,17 +383,6 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam SuccessOrExit(err = _controllerFactory->Init(params)); } - // This needs to happen after DeviceControllerFactory::Init, - // because that creates (lazily, by calling functions with - // static variables in them) some static-lifetime objects. - if (!sExitHandlerRegistered) { - if (atexit(ShutdownOnExit) != 0) { - char error[128]; - strerror_r(errno, error, sizeof(error)); - MTR_LOG_ERROR("Warning: Failed to register atexit handler: %s", error); - } - sExitHandlerRegistered = true; - } HeapObjectPoolExitHandling::IgnoreLeaksOnExit(); // Make sure we don't leave a system state running while we have no diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 98d9f2b342c909..c4694884ea829d 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -607,7 +607,7 @@ + (NSUInteger)generateRandomPIN return setupPIN; } - // We got pretty unlikely with our random number generation. Just try + // We got pretty unlucky with our random number generation. Just try // again. The chance that this loop does not terminate in a reasonable // amount of time is astronomically low, assuming arc4random_uniform is not // broken.