paclema / WebConfigServer

Arduino/ESP library with a Web Server to manage device configurations under config.json file stored in the SPIFFS and plot values into real-time dashboard for ESP8266 and ESP32

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cleanup memory leak from webserver onNetworkConnected()

paclema opened this issue · comments

It seems that there is a memory leak since the reconnection process is not that clean for the webserver client.

https://github.com/paclema/WebConfigServer/blob/main/src/WebConfigServer.h#L328

It should be introduced a stop and clean (only once, if the webserver client still runs) on the onNetworkDisconnected() callback.

https://github.com/paclema/WebConfigServer/blob/main/src/WebConfigServer.h#L346

Presumably, I could just configure once the webserver before starting the wifi connection as this example shows: NAPTCaptivePortal.ino