esphome / ESPAsyncWebServer

Async Web Server for ESP8266 and ESP32
82 stars 62 forks source link

Don't delete handlers when they're removed #6

Closed oxan closed 3 years ago

oxan commented 3 years ago

This was an utterly idiotic API; if you accept pointers, you can't just assume ownership over them and unconditionally destroy them whenever you like too.

This broke the captive portal: when it stopped, it deinitialized the webserver, which deleted its handlers. As the captive portal object itself was one of the handlers, it and its member objects were now destroyed, and that caused its own continuing teardown to use-after-free or double-free (see esphome/esphome#2686).