From 757a5d8ec31aadcf387ac3cb135256152c18de1c Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 6 Jul 2017 20:16:18 +0300 Subject: [PATCH] Add virtual destructor to NetworkAddress. Subclasses of NetworkAddress are deleted using pointers to the base class, so a virtual destructor is required. Also fix a couple of warnings on 64bit. --- NetworkSocket.cpp | 2 +- NetworkSocket.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NetworkSocket.cpp b/NetworkSocket.cpp index 4071b7c..3f7f02e 100644 --- a/NetworkSocket.cpp +++ b/NetworkSocket.cpp @@ -292,7 +292,7 @@ void NetworkSocketTCPObfuscated::Receive(NetworkPacket *packet){ } if(packetLen>packet->length){ - LOGW("packet too big to fit into buffer (%u vs %u)", packetLen, packet->length); + LOGW("packet too big to fit into buffer (%u vs %u)", (unsigned int)packetLen, (unsigned int)packet->length); packet->length=0; return; } diff --git a/NetworkSocket.h b/NetworkSocket.h index e66015f..6c89d74 100644 --- a/NetworkSocket.h +++ b/NetworkSocket.h @@ -28,6 +28,7 @@ namespace tgvoip { virtual std::string ToString()=0; bool operator==(const NetworkAddress& other); bool operator!=(const NetworkAddress& other); + virtual ~NetworkAddress()=default; }; class IPv4Address : public NetworkAddress{