Skip to content

Commit 9a05eaf

Browse files
committed
[WiFi] Destruct WiFi object when wifi needs to be reset
See esp8266/Arduino#5527 (comment)
1 parent 61d4c50 commit 9a05eaf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ESPEasyWifi.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,13 @@ void resetWiFi() {
257257
addLog(LOG_LEVEL_INFO, F("Reset WiFi."));
258258
lastDisconnectMoment = millis();
259259
WifiDisconnect();
260-
// setWifiMode(WIFI_OFF);
260+
// setWifiMode(WIFI_OFF);
261+
262+
#ifdef ESP8266
263+
// See https://github.com/esp8266/Arduino/issues/5527#issuecomment-460537616
264+
WiFi.~ESP8266WiFiClass();
265+
WiFi = ESP8266WiFiClass();
266+
#endif
261267
}
262268

263269
void connectionCheckHandler()

0 commit comments

Comments
 (0)