Skip to content

Commit 533a600

Browse files
iSevenDaysigrr
authored andcommitted
Add virtual destructor to WiFiServer class (#2116)
Without this line compiler complains about : Warning 22:9: warning: deleting object of polymorphic class type 'WiFiServer' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor] \\Mac\Home\Documents\Visual Studio 2015\Projects\BlinkESP8266_12\ActAsWiFi_server\SVServer.cpp 22 Reason for this is that I would like to init WiFiServer with port which can by dynamically chosen (for example by serial port) internalServer = new WiFiServer(port);
1 parent 5eb6a7f commit 533a600

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/ESP8266WiFi/src/WiFiServer.h

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class WiFiServer : public Server {
4747
public:
4848
WiFiServer(IPAddress addr, uint16_t port);
4949
WiFiServer(uint16_t port);
50+
virtual ~WiFiServer() {}
5051
WiFiClient available(uint8_t* status = NULL);
5152
bool hasClient();
5253
void begin();

0 commit comments

Comments
 (0)