Ensure that NVRAM is persisted when exiting the debugger after an abort

The SIGABRT handler is not invoked by the abort() call in the loguru
fatal handler, but either way it's not necessary (it does its own abort).

Switch to explicitly cleaning up the machine object, which as a side
effect in the destructor chain will persist the NVRAM.
This commit is contained in:
Mihai Parparita 2024-03-09 11:56:43 -08:00 committed by Maxim Poliakovski
parent 284f58dec4
commit fc6a4872d6
1 changed files with 2 additions and 1 deletions

View File

@ -176,7 +176,8 @@ int main(int argc, char** argv) {
power_off_reason = po_enter_debugger;
enter_debugger();
abort();
// Ensure that NVRAM and other state is persisted before we terminate.
delete gMachineObj.release();
});
// redirect SIGINT to our own handler