Skip to content

Commit

Permalink
Add virtual destructor to NetworkAddress.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
john-preston committed Jul 6, 2017
1 parent 445433f commit 757a5d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NetworkSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions NetworkSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 757a5d8

Please sign in to comment.