1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-14 13:41:23 +03:00

Update LEAmDNS.cpp (fix issue #6982) (#7025)

* Update LEAmDNS.cpp (issue #6982)

Check m_pUDPContext before calling functions to reset WiFi event callbacks, stop probing ... to close #6982

* Update LEAmDNS.cpp

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
This commit is contained in:
LeisureLadi
2020-01-28 01:08:30 +01:00
committed by Earle F. Philhower, III
parent 0c6be9e114
commit 7b0fa3554c

View File

@ -215,18 +215,26 @@ bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& p_IPAddress
*/ */
bool MDNSResponder::close(void) bool MDNSResponder::close(void)
{ {
bool bResult = false;
m_GotIPHandler.reset(); // reset WiFi event callbacks. if (0 != m_pUDPContext)
m_DisconnectedHandler.reset(); {
m_GotIPHandler.reset(); // reset WiFi event callbacks.
m_DisconnectedHandler.reset();
_announce(false, true); _announce(false, true);
_resetProbeStatus(false); // Stop probing _resetProbeStatus(false); // Stop probing
_releaseServiceQueries();
_releaseUDPContext();
_releaseHostname();
_releaseServiceQueries(); bResult = true;
_releaseUDPContext(); }
_releaseHostname(); else
{
return true; DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
}
return bResult;
} }
/* /*