Manage when destructor is called for native HttpAPI (#5807)

This commit is contained in:
Eric Severance
2025-01-11 04:15:50 -08:00
committed by GitHub
parent 077ee02426
commit e7802d960f
3 changed files with 31 additions and 32 deletions

View File

@@ -92,6 +92,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
#include "mesh/raspihttp/PiWebServer.h"
#include "platform/portduino/PortduinoGlue.h"
#include "platform/portduino/USBHal.h"
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
@@ -1159,6 +1160,7 @@ void setup()
#if __has_include(<ulfius.h>)
if (settingsMap[webserverport] != -1) {
piwebServerThread = new PiWebServerThread();
std::atexit([] { delete piwebServerThread; });
}
#endif
initApiServer(TCPPort);
@@ -1278,4 +1280,4 @@ void loop()
mainDelay.delay(delayMsec);
}
}
#endif
#endif