mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +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;
|
||||
addr.addr = ip;
|
||||
|
||||
if (_client)
|
||||
if (_client) {
|
||||
stop();
|
||||
_client->unref();
|
||||
_client = nullptr;
|
||||
}
|
||||
|
||||
// if the default interface is down, tcp_connect exits early without
|
||||
// ever calling tcp_err
|
||||
|
Reference in New Issue
Block a user