[wifi] Call the SDK disconnect directly before an LN882x reboot

This commit is contained in:
J. Nick Koston
2026-10-04 20:57:51 -05:00
parent 515e15e6c0
commit f34847a92c
@@ -796,7 +796,9 @@ void WiFiComponent::on_shutdown() {
if (!this->is_connected())
return;
ESP_LOGD(TAG, "Disconnecting before reboot");
this->wifi_disconnect_();
// The SDK call directly: LibreTiny's WiFi.disconnect() also frees the SSID
// its event handlers read, which once hung a reboot until the watchdog.
wifi_sta_disconnect();
delay(100); // let the deauth go out before the reset
}
#endif