Skip to content

Commit d683c94

Browse files
committed
Release referenced resources in destructor, corrected for IPV6
1 parent d45cbcb commit d683c94

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libraries/ESP8266SSDP/ESP8266SSDP.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,9 @@ SSDPClass::~SSDPClass() {
164164
_server = 0;
165165
}
166166

167-
ip_addr_t ifaddr;
168-
ifaddr.addr = WiFi.localIP();
169-
ip_addr_t multicast_addr;
170-
multicast_addr.addr = (uint32_t) SSDP_MULTICAST_ADDR;
171-
if (igmp_leavegroup(&ifaddr, &multicast_addr) != ERR_OK ) {
167+
IPAddress local = WiFi.localIP();
168+
IPAddress mcast(SSDP_MULTICAST_ADDR);
169+
if (igmp_leavegroup(local, mcast) != ERR_OK ) {
172170
#ifdef DEBUG_SSDP
173171
DEBUG_SSDP.printf("SSDP failed to leave igmp group\n");
174172
#endif

0 commit comments

Comments
 (0)