Skip to content

Commit 8a01f93

Browse files
Remove no-op ShutdownOnExit. (project-chip#36002)
1 parent 88bf438 commit 8a01f93

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm

-17
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@
7070
using namespace chip::Controller;
7171
using namespace chip::Tracing::DarwinFramework;
7272

73-
static bool sExitHandlerRegistered = false;
74-
static void ShutdownOnExit()
75-
{
76-
// Don't do anything here, period
77-
}
78-
7973
@interface MTRDeviceControllerFactoryParams ()
8074

8175
// Flag to keep track of whether our .storage is real consumer-provided storage
@@ -389,17 +383,6 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam
389383
SuccessOrExit(err = _controllerFactory->Init(params));
390384
}
391385

392-
// This needs to happen after DeviceControllerFactory::Init,
393-
// because that creates (lazily, by calling functions with
394-
// static variables in them) some static-lifetime objects.
395-
if (!sExitHandlerRegistered) {
396-
if (atexit(ShutdownOnExit) != 0) {
397-
char error[128];
398-
strerror_r(errno, error, sizeof(error));
399-
MTR_LOG_ERROR("Warning: Failed to register atexit handler: %s", error);
400-
}
401-
sExitHandlerRegistered = true;
402-
}
403386
HeapObjectPoolExitHandling::IgnoreLeaksOnExit();
404387

405388
// Make sure we don't leave a system state running while we have no

src/darwin/Framework/CHIP/MTRSetupPayload.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ + (NSUInteger)generateRandomPIN
607607
return setupPIN;
608608
}
609609

610-
// We got pretty unlikely with our random number generation. Just try
610+
// We got pretty unlucky with our random number generation. Just try
611611
// again. The chance that this loop does not terminate in a reasonable
612612
// amount of time is astronomically low, assuming arc4random_uniform is not
613613
// broken.

0 commit comments

Comments
 (0)