Skip to content

Commit

Permalink
Remove no-op ShutdownOnExit. (#36002)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored Oct 10, 2024
1 parent 88bf438 commit 8a01f93
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRSetupPayload.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8a01f93

Please sign in to comment.