diff options
author | Rubidium <rubidium@openttd.org> | 2021-05-12 23:06:35 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-13 10:03:26 +0200 |
commit | 187a3f20bfd7578362f666b869580bafe25ffd0b (patch) | |
tree | 5fcc3ca99b265880771c083252cd2eb2c3ed559a /src/network/core/core.h | |
parent | 7755f81bb8ba1c6a47e3a528acbbc462e56adaff (diff) | |
download | openttd-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/core.h')
-rw-r--r-- | src/network/core/core.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/network/core/core.h b/src/network/core/core.h index 37948ad52..a16ed9f23 100644 --- a/src/network/core/core.h +++ b/src/network/core/core.h @@ -46,10 +46,7 @@ public: NetworkSocketHandler() { this->has_quit = false; } /** Close the socket when destructing the socket handler */ - virtual ~NetworkSocketHandler() { this->Close(); } - - /** Really close the socket */ - virtual void Close() {} + virtual ~NetworkSocketHandler() {} /** * Close the current connection; for TCP this will be mostly equivalent |