mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
WiFiClient: clean up ClientContext before connecting (#4516)
Fixes https://github.com/esp8266/Arduino/issues/4497
This commit is contained in:
@ -112,8 +112,11 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
|
|||||||
ip_addr_t addr;
|
ip_addr_t addr;
|
||||||
addr.addr = ip;
|
addr.addr = ip;
|
||||||
|
|
||||||
if (_client)
|
if (_client) {
|
||||||
stop();
|
stop();
|
||||||
|
_client->unref();
|
||||||
|
_client = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// if the default interface is down, tcp_connect exits early without
|
// if the default interface is down, tcp_connect exits early without
|
||||||
// ever calling tcp_err
|
// ever calling tcp_err
|
||||||
|
Reference in New Issue
Block a user