summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_content.cpp
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-05-12 23:06:35 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-13 10:03:26 +0200
commit187a3f20bfd7578362f666b869580bafe25ffd0b (patch)
tree5fcc3ca99b265880771c083252cd2eb2c3ed559a /src/network/core/tcp_content.cpp
parent7755f81bb8ba1c6a47e3a528acbbc462e56adaff (diff)
downloadopenttd-187a3f20bfd7578362f666b869580bafe25ffd0b.tar.xz
Codechange: remove pointless close call due to resolving virtual functions statically in destructors
In the destructors of many of the network related classes Close() is called, just like the top class in that hierarchy. However, due to virtual functions getting resolved statically in the destructor it would always call the empty Close() of the top class. Document the other cases where a virtual call is resolved statically.
Diffstat (limited to 'src/network/core/tcp_content.cpp')
-rw-r--r--src/network/core/tcp_content.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/core/tcp_content.cpp b/src/network/core/tcp_content.cpp
index 0371b7621..3abf1c29c 100644
--- a/src/network/core/tcp_content.cpp
+++ b/src/network/core/tcp_content.cpp
@@ -137,9 +137,11 @@ const char *ContentInfo::GetTextfile(TextfileType type) const
return ::GetTextfile(type, GetContentInfoSubDir(this->type), tmp);
}
-void NetworkContentSocketHandler::Close()
+/**
+ * Close the actual socket.
+ */
+void NetworkContentSocketHandler::CloseSocket()
{
- CloseConnection();
if (this->sock == INVALID_SOCKET) return;
closesocket(this->sock);