diff --git a/src/Power.cpp b/src/Power.cpp index b489bc33c..8a16132f1 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -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 diff --git a/src/mesh/api/WiFiServerAPI.cpp b/src/mesh/api/WiFiServerAPI.cpp index 5b63bc165..b19194f78 100644 --- a/src/mesh/api/WiFiServerAPI.cpp +++ b/src/mesh/api/WiFiServerAPI.cpp @@ -17,7 +17,10 @@ void initApiServer(int port) } void deInitApiServer() { - delete apiPort; + if (apiPort) { + delete apiPort; + apiPort = nullptr; + } } WiFiServerAPI::WiFiServerAPI(WiFiClient &_client) : ServerAPI(_client)