mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-17 16:22:48 +00:00
Manage when destructor is called for native HttpAPI (#5807)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user