Fix a crash on Native reboot (#7570)

This commit is contained in:
Jonathan Bennett
2025-08-07 12:28:01 -05:00
committed by GitHub
parent f2a880f813
commit 8568b56ac6
2 changed files with 8 additions and 3 deletions

View File

@@ -724,10 +724,12 @@ void Power::reboot()
SPI.end();
Wire.end();
Serial1.end();
if (screen)
if (screen) {
delete screen;
screen = nullptr;
}
LOG_DEBUG("final reboot!");
reboot();
::reboot();
#elif defined(ARCH_STM32WL)
HAL_NVIC_SystemReset();
#else

View File

@@ -17,7 +17,10 @@ void initApiServer(int port)
}
void deInitApiServer()
{
delete apiPort;
if (apiPort) {
delete apiPort;
apiPort = nullptr;
}
}
WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : ServerAPI(_client)