diff --git a/src/ai/ai_scanner.hpp b/src/ai/ai_scanner.hpp index 7f0a0a3916..5da4e443dd 100644 --- a/src/ai/ai_scanner.hpp +++ b/src/ai/ai_scanner.hpp @@ -15,7 +15,7 @@ class AIScannerInfo : public ScriptScanner { public: AIScannerInfo(); - ~AIScannerInfo(); + ~AIScannerInfo() override; void Initialize() override; diff --git a/src/aircraft.h b/src/aircraft.h index 002fa48a23..624750050c 100644 --- a/src/aircraft.h +++ b/src/aircraft.h @@ -85,7 +85,7 @@ struct Aircraft final : public SpecializedVehicle { /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ Aircraft() : SpecializedVehicleBase() {} /** We want to 'destruct' the right class. */ - virtual ~Aircraft() { this->PreDestructor(); } + ~Aircraft() override { this->PreDestructor(); } void MarkDirty() override; void UpdateDeltaXY() override; diff --git a/src/base_media_base.h b/src/base_media_base.h index edb3fe1d5c..da1261a60e 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -48,6 +48,8 @@ template struct BaseSetTraits; */ template struct BaseSet { + virtual ~BaseSet() = default; + typedef std::unordered_map> TranslatedStrings; /** Number of files in this set */ diff --git a/src/base_media_graphics.h b/src/base_media_graphics.h index b455d180a3..b9c53d9fef 100644 --- a/src/base_media_graphics.h +++ b/src/base_media_graphics.h @@ -46,7 +46,7 @@ public: BlitterType blitter{}; ///< Blitter of this graphics set GraphicsSet(); - ~GraphicsSet(); + ~GraphicsSet() override; bool FillSetDetails(const IniFile &ini, const std::string &path, const std::string &full_filename); GRFConfig *GetExtraConfig() const { return this->extra_cfg.get(); } diff --git a/src/blitter/base.hpp b/src/blitter/base.hpp index 56fcf8e71e..de1be5c230 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -204,8 +204,6 @@ public: */ virtual void PostResize() { }; - virtual ~Blitter() = default; - template void DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, int screen_height, int width, int dash, SetPixelT set_pixel); template static void MovePixels(const T *src, T *dst, size_t width, size_t height, ptrdiff_t pitch); diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 3c62d3bd1c..fd758e2195 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -304,7 +304,7 @@ public: _network_content_client.Connect(); } - ~BootstrapEmscripten() + ~BootstrapEmscripten() override { _network_content_client.RemoveCallback(this); } diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 9bd7744aa7..844d7c3b54 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -176,7 +176,7 @@ public: this->vscroll->SetCount(this->bridges.size()); } - ~BuildBridgeWindow() + ~BuildBridgeWindow() override { BuildBridgeWindow::last_sorting = this->bridges.GetListing(); } diff --git a/src/disaster_vehicle.h b/src/disaster_vehicle.h index bf0cce2c1a..d178f05982 100644 --- a/src/disaster_vehicle.h +++ b/src/disaster_vehicle.h @@ -44,7 +44,7 @@ struct DisasterVehicle final : public SpecializedVehicle::Register(*this); } - virtual ~FontCacheFactory() + ~FontCacheFactory() override { ProviderManager::Unregister(*this); } diff --git a/src/fontcache/freetypefontcache.cpp b/src/fontcache/freetypefontcache.cpp index e3f85d23da..0129c9c84d 100644 --- a/src/fontcache/freetypefontcache.cpp +++ b/src/fontcache/freetypefontcache.cpp @@ -39,7 +39,7 @@ private: public: FreeTypeFontCache(FontSize fs, FT_Face face, int pixels); - ~FreeTypeFontCache(); + ~FreeTypeFontCache() override; void ClearFontCache() override; GlyphID MapCharToGlyph(char32_t key, bool allow_fallback = true) override; std::string GetFontName() override { return fmt::format("{}, {}", face->family_name, face->style_name); } @@ -213,7 +213,7 @@ class FreeTypeFontCacheFactory : public FontCacheFactory { public: FreeTypeFontCacheFactory() : FontCacheFactory("freetype", "FreeType font provider") {} - virtual ~FreeTypeFontCacheFactory() + ~FreeTypeFontCacheFactory() override { FT_Done_FreeType(_ft_library); _ft_library = nullptr; diff --git a/src/fontcache/truetypefontcache.h b/src/fontcache/truetypefontcache.h index b9a58c6326..19e7b0a2a1 100644 --- a/src/fontcache/truetypefontcache.h +++ b/src/fontcache/truetypefontcache.h @@ -44,7 +44,7 @@ protected: public: TrueTypeFontCache(FontSize fs, int pixels); - virtual ~TrueTypeFontCache(); + ~TrueTypeFontCache() override; int GetFontSize() const override { return this->used_size; } const Sprite *GetGlyph(GlyphID key) override; void ClearFontCache() override; diff --git a/src/gfx_layout_icu.cpp b/src/gfx_layout_icu.cpp index 984990324c..d3fd11e196 100644 --- a/src/gfx_layout_icu.cpp +++ b/src/gfx_layout_icu.cpp @@ -109,7 +109,7 @@ public: this->Reflow(); } - ~ICUParagraphLayout() override { } + ~ICUParagraphLayout() override = default; void Reflow() override { diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 54fb9af1ab..dedce7b61c 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -831,7 +831,7 @@ public: this->InvalidateData(); } - ~IndustryViewWindow() + ~IndustryViewWindow() override { CloseWindowById(WC_INDUSTRY_PRODUCTION, this->window_number, false); } @@ -1665,7 +1665,7 @@ public: this->industry_editbox.cancel_button = QueryString::ACTION_CLEAR; } - ~IndustryDirectoryWindow() + ~IndustryDirectoryWindow() override { this->last_sorting = this->industries.GetListing(); } diff --git a/src/linkgraph/demands.h b/src/linkgraph/demands.h index 9e0ac16e81..a01a038924 100644 --- a/src/linkgraph/demands.h +++ b/src/linkgraph/demands.h @@ -44,7 +44,7 @@ public: /** * Virtual destructor has to be defined because of virtual Run(). */ - virtual ~DemandHandler() = default; + ~DemandHandler() override = default; }; #endif /* DEMANDS_H */ diff --git a/src/music/dmusic.h b/src/music/dmusic.h index 3b5a1b31c4..0eba5042b4 100644 --- a/src/music/dmusic.h +++ b/src/music/dmusic.h @@ -15,7 +15,7 @@ /** Music player making use of DirectX. */ class MusicDriver_DMusic : public MusicDriver { public: - virtual ~MusicDriver_DMusic(); + ~MusicDriver_DMusic() override; std::optional Start(const StringList ¶m) override; diff --git a/src/network/core/tcp.h b/src/network/core/tcp.h index 7013423e25..bbb4da5e45 100644 --- a/src/network/core/tcp.h +++ b/src/network/core/tcp.h @@ -63,7 +63,7 @@ public: * @param s The just opened TCP connection. */ NetworkTCPSocketHandler(SOCKET s = INVALID_SOCKET) : sock(s) {} - ~NetworkTCPSocketHandler(); + ~NetworkTCPSocketHandler() override; }; /** diff --git a/src/network/core/tcp_content.h b/src/network/core/tcp_content.h index 0047781f42..0d8d30b058 100644 --- a/src/network/core/tcp_content.h +++ b/src/network/core/tcp_content.h @@ -124,7 +124,7 @@ public: } /** On destructing of this class, the socket needs to be closed */ - virtual ~NetworkContentSocketHandler() + ~NetworkContentSocketHandler() override { /* Virtual functions get called statically in destructors, so make it explicit to remove any confusion. */ this->CloseSocket(); diff --git a/src/network/core/tcp_game.h b/src/network/core/tcp_game.h index e2456dace0..c0e3652b43 100644 --- a/src/network/core/tcp_game.h +++ b/src/network/core/tcp_game.h @@ -493,7 +493,7 @@ public: * @param status The reason the connection got closed. */ virtual NetworkRecvStatus CloseConnection(NetworkRecvStatus status) = 0; - virtual ~NetworkGameSocketHandler() = default; + ~NetworkGameSocketHandler() override = default; /** * Sets the client info for this socket handler. diff --git a/src/network/core/udp.h b/src/network/core/udp.h index 0d147f8af3..d184705e98 100644 --- a/src/network/core/udp.h +++ b/src/network/core/udp.h @@ -49,7 +49,7 @@ public: NetworkUDPSocketHandler(NetworkAddressList *bind = nullptr); /** On destructing of this class, the socket needs to be closed */ - virtual ~NetworkUDPSocketHandler() { this->CloseSocket(); } + ~NetworkUDPSocketHandler() override { this->CloseSocket(); } bool Listen(); void CloseSocket(); diff --git a/src/network/network_admin.h b/src/network/network_admin.h index b0b24af218..05fe6e6e66 100644 --- a/src/network/network_admin.h +++ b/src/network/network_admin.h @@ -48,7 +48,7 @@ public: NetworkAddress address{}; ///< Address of the admin. ServerNetworkAdminSocketHandler(SOCKET s); - ~ServerNetworkAdminSocketHandler(); + ~ServerNetworkAdminSocketHandler() override; NetworkRecvStatus SendError(NetworkErrorCode error); NetworkRecvStatus SendWelcome(); diff --git a/src/network/network_client.h b/src/network/network_client.h index 4baae985d8..f8e95bdf45 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -75,7 +75,7 @@ protected: void CheckConnection(); public: ClientNetworkGameSocketHandler(SOCKET s, std::string_view connection_string); - ~ClientNetworkGameSocketHandler(); + ~ClientNetworkGameSocketHandler() override; NetworkRecvStatus CloseConnection(NetworkRecvStatus status) override; void ClientError(NetworkRecvStatus res); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index fd4112d41d..a92c58f7a3 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -461,7 +461,7 @@ public: this->servers.ForceRebuild(); } - ~NetworkGameWindow() + ~NetworkGameWindow() override { this->last_sorting = this->servers.GetListing(); } diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 20c6edb817..b3535977a2 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -81,7 +81,7 @@ struct PacketWriter : SaveFilter { } /** Make sure everything is cleaned up. */ - ~PacketWriter() + ~PacketWriter() override { std::unique_lock lock(this->mutex); diff --git a/src/network/network_server.h b/src/network/network_server.h index e0d3a3b1bd..35b39ae7ae 100644 --- a/src/network/network_server.h +++ b/src/network/network_server.h @@ -75,7 +75,7 @@ public: NetworkAddress client_address{}; ///< IP-address of the client (so they can be banned) ServerNetworkGameSocketHandler(SOCKET s); - ~ServerNetworkGameSocketHandler(); + ~ServerNetworkGameSocketHandler() override; std::unique_ptr ReceivePacket() override; NetworkRecvStatus CloseConnection(NetworkRecvStatus status) override; diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index 0dba435029..5e7c60d880 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -59,7 +59,7 @@ public: * @param addresses The addresses to bind on. */ ServerNetworkUDPSocketHandler(NetworkAddressList *addresses) : NetworkUDPSocketHandler(addresses) {} - virtual ~ServerNetworkUDPSocketHandler() = default; + ~ServerNetworkUDPSocketHandler() override = default; }; void ServerNetworkUDPSocketHandler::Receive_CLIENT_FIND_SERVER(Packet &, NetworkAddress &client_addr) @@ -77,7 +77,7 @@ class ClientNetworkUDPSocketHandler : public NetworkUDPSocketHandler { protected: void Receive_SERVER_RESPONSE(Packet &p, NetworkAddress &client_addr) override; public: - virtual ~ClientNetworkUDPSocketHandler() = default; + ~ClientNetworkUDPSocketHandler() override = default; }; void ClientNetworkUDPSocketHandler::Receive_SERVER_RESPONSE(Packet &, NetworkAddress &client_addr) diff --git a/src/newgrf/newgrf_act3.cpp b/src/newgrf/newgrf_act3.cpp index f9e20c3d6e..0ca425dc2f 100644 --- a/src/newgrf/newgrf_act3.cpp +++ b/src/newgrf/newgrf_act3.cpp @@ -155,7 +155,7 @@ static void VehicleMapSpriteGroup(ByteReader &buf, GrfSpecFeature feature, uint8 /** Handler interface for mapping sprite groups. */ struct MapSpriteGroupHandler { - virtual ~MapSpriteGroupHandler() {} + virtual ~MapSpriteGroupHandler() = default; virtual void MapSpecific(uint16_t local_id, uint8_t cid, const SpriteGroup *group) = 0; virtual void MapDefault(uint16_t local_id, const SpriteGroup *group) = 0; }; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 1d1d409020..85e53798b7 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -2036,7 +2036,7 @@ struct SavePresetWindow : public Window { this->presetname_editbox.text.Assign(initial_text); } - ~SavePresetWindow() + ~SavePresetWindow() override { } diff --git a/src/os/macosx/font_osx.h b/src/os/macosx/font_osx.h index 41024a8525..4b9f0d8f85 100644 --- a/src/os/macosx/font_osx.h +++ b/src/os/macosx/font_osx.h @@ -25,7 +25,6 @@ class CoreTextFontCache : public TrueTypeFontCache { const Sprite *InternalGetGlyph(GlyphID key, bool use_aa) override; public: CoreTextFontCache(FontSize fs, CFAutoRelease &&font, int pixels); - ~CoreTextFontCache() {} void ClearFontCache() override; GlyphID MapCharToGlyph(char32_t key, bool allow_fallback = true) override; diff --git a/src/os/windows/font_win32.h b/src/os/windows/font_win32.h index 264efe00e5..6a9d780d8b 100644 --- a/src/os/windows/font_win32.h +++ b/src/os/windows/font_win32.h @@ -35,7 +35,7 @@ protected: public: Win32FontCache(FontSize fs, const LOGFONT &logfont, int pixels); - ~Win32FontCache(); + ~Win32FontCache() override; void ClearFontCache() override; GlyphID MapCharToGlyph(char32_t key, bool allow_fallback = true) override; std::string GetFontName() override { return this->fontname; } diff --git a/src/os/windows/string_uniscribe.cpp b/src/os/windows/string_uniscribe.cpp index 5c45e881f6..ca99868e25 100644 --- a/src/os/windows/string_uniscribe.cpp +++ b/src/os/windows/string_uniscribe.cpp @@ -119,7 +119,7 @@ public: this->Reflow(); } - ~UniscribeParagraphLayout() override {} + ~UniscribeParagraphLayout() override = default; void Reflow() override { diff --git a/src/provider_manager.h b/src/provider_manager.h index 745282572e..8a5e61d41a 100644 --- a/src/provider_manager.h +++ b/src/provider_manager.h @@ -54,7 +54,7 @@ template class BaseProvider { public: constexpr BaseProvider(std::string_view name, std::string_view description) : name(name), description(description) {} - virtual ~BaseProvider() {} + virtual ~BaseProvider() = default; inline std::string_view GetName() const { return this->name; } inline std::string_view GetDescription() const { return this->description; } @@ -82,7 +82,6 @@ template class PriorityBaseProvider : public BaseProvider { public: constexpr PriorityBaseProvider(std::string_view name, std::string_view description, int priority) : BaseProvider(name, description), priority(priority) {} - virtual ~PriorityBaseProvider() {} inline int GetPriority() const { return this->priority; } diff --git a/src/roadveh.h b/src/roadveh.h index ea2e4081a2..71e56dcc0c 100644 --- a/src/roadveh.h +++ b/src/roadveh.h @@ -112,7 +112,7 @@ struct RoadVehicle final : public GroundVehicle { /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ RoadVehicle() : GroundVehicleBase() {} /** We want to 'destruct' the right class. */ - virtual ~RoadVehicle() { this->PreDestructor(); } + ~RoadVehicle() override { this->PreDestructor(); } friend struct GroundVehicle; // GroundVehicle needs to use the acceleration functions defined at RoadVehicle. diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index a376b30944..cf9f43b841 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -2365,7 +2365,7 @@ struct FileReader : LoadFilter { } /** Make sure everything is cleaned up. */ - ~FileReader() + ~FileReader() override { if (this->file.has_value()) { _game_session_stats.savegame_size = ftell(*this->file) - this->begin; @@ -2402,7 +2402,7 @@ struct FileWriter : SaveFilter { } /** Make sure everything is cleaned up. */ - ~FileWriter() + ~FileWriter() override { this->Finish(); } @@ -2573,7 +2573,7 @@ struct ZlibLoadFilter : LoadFilter { } /** Clean everything up. */ - ~ZlibLoadFilter() + ~ZlibLoadFilter() override { inflateEnd(&this->z); } @@ -2617,7 +2617,7 @@ struct ZlibSaveFilter : SaveFilter { } /** Clean up what we allocated. */ - ~ZlibSaveFilter() + ~ZlibSaveFilter() override { deflateEnd(&this->z); } @@ -2700,7 +2700,7 @@ struct LZMALoadFilter : LoadFilter { } /** Clean everything up. */ - ~LZMALoadFilter() + ~LZMALoadFilter() override { lzma_end(&this->lzma); } @@ -2743,7 +2743,7 @@ struct LZMASaveFilter : SaveFilter { } /** Clean up what we allocated. */ - ~LZMASaveFilter() + ~LZMASaveFilter() override { lzma_end(&this->lzma); } diff --git a/src/screenshot_type.h b/src/screenshot_type.h index f2b6ba2111..92015bc9b8 100644 --- a/src/screenshot_type.h +++ b/src/screenshot_type.h @@ -31,7 +31,7 @@ public: ProviderManager::Register(*this); } - virtual ~ScreenshotProvider() + ~ScreenshotProvider() override { ProviderManager::Unregister(*this); } diff --git a/src/script/api/script_accounting.hpp b/src/script/api/script_accounting.hpp index 2cf9ac0b61..9bf2b31935 100644 --- a/src/script/api/script_accounting.hpp +++ b/src/script/api/script_accounting.hpp @@ -40,7 +40,7 @@ public: * So basically restore the value of GetCosts to what it was before we * created this instance. */ - ~ScriptAccounting(); + ~ScriptAccounting() override; /** * Get the current value of the costs. diff --git a/src/script/api/script_asyncmode.hpp b/src/script/api/script_asyncmode.hpp index f282b43053..60cfe8611e 100644 --- a/src/script/api/script_asyncmode.hpp +++ b/src/script/api/script_asyncmode.hpp @@ -52,7 +52,7 @@ public: * Destroying this instance resets the asynchronous mode to the mode it was * in when the instance was created. */ - ~ScriptAsyncMode(); + ~ScriptAsyncMode() override; /** * @api -all diff --git a/src/script/api/script_companymode.hpp b/src/script/api/script_companymode.hpp index 2fbbd9dd31..0f1f2b1601 100644 --- a/src/script/api/script_companymode.hpp +++ b/src/script/api/script_companymode.hpp @@ -47,7 +47,7 @@ public: * Destroying this instance reset the company to that what it was * in when the instance was created. */ - ~ScriptCompanyMode(); + ~ScriptCompanyMode() override; /** * Check whether a company mode is valid. In other words, are commands diff --git a/src/script/api/script_execmode.hpp b/src/script/api/script_execmode.hpp index b847bb433c..435d6bb574 100644 --- a/src/script/api/script_execmode.hpp +++ b/src/script/api/script_execmode.hpp @@ -43,7 +43,7 @@ public: * Destroying this instance reset the building mode to the mode it was * in when the instance was created. */ - ~ScriptExecMode(); + ~ScriptExecMode() override; /** * @api -all diff --git a/src/script/api/script_list.hpp b/src/script/api/script_list.hpp index 3e7e02b65e..ad4b7a3ac8 100644 --- a/src/script/api/script_list.hpp +++ b/src/script/api/script_list.hpp @@ -173,7 +173,7 @@ public: ScriptListSet values; ///< The items in the list, sorted by value ScriptList(); - ~ScriptList(); + ~ScriptList() override; #ifdef DOXYGEN_API /** diff --git a/src/script/api/script_priorityqueue.hpp b/src/script/api/script_priorityqueue.hpp index 6b6daace08..c3c3354e90 100644 --- a/src/script/api/script_priorityqueue.hpp +++ b/src/script/api/script_priorityqueue.hpp @@ -33,7 +33,7 @@ private: std::vector queue; ///< The priority list public: - ~ScriptPriorityQueue(); + ~ScriptPriorityQueue() override; #ifdef DOXYGEN_API /** diff --git a/src/script/api/script_testmode.hpp b/src/script/api/script_testmode.hpp index 475e52e337..0f35be0bb7 100644 --- a/src/script/api/script_testmode.hpp +++ b/src/script/api/script_testmode.hpp @@ -45,7 +45,7 @@ public: * Destroying this instance reset the building mode to the mode it was * in when the instance was created. */ - ~ScriptTestMode(); + ~ScriptTestMode() override; /** * @api -all diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index 29c068c221..d84a904fd5 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -781,7 +781,7 @@ struct ScriptDebugWindow : public Window { this->InvalidateData(-1); } - ~ScriptDebugWindow() + ~ScriptDebugWindow() override { ScriptDebugWindow::initial_state = this->filter; } diff --git a/src/script/script_scanner.hpp b/src/script/script_scanner.hpp index 5346d58887..1c2e0f5946 100644 --- a/src/script/script_scanner.hpp +++ b/src/script/script_scanner.hpp @@ -19,7 +19,7 @@ using ScriptInfoList = std::map { /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ Ship() : SpecializedVehicleBase() {} /** We want to 'destruct' the right class. */ - virtual ~Ship() { this->PreDestructor(); } + ~Ship() override { this->PreDestructor(); } void MarkDirty() override; void UpdateDeltaXY() override; diff --git a/src/sound/xaudio2_s.cpp b/src/sound/xaudio2_s.cpp index c9b29ea694..0a73acd109 100644 --- a/src/sound/xaudio2_s.cpp +++ b/src/sound/xaudio2_s.cpp @@ -56,6 +56,8 @@ public: this->buffer.resize(buffer_length); } + /* This needs to be virtual because the XAudio2 API declares the interface without + * a virtual destructor, even though it has functions that need to be overridden. */ virtual ~StreamingVoiceContext() = default; HRESULT SubmitBuffer() diff --git a/src/soundloader_type.h b/src/soundloader_type.h index 840219f350..06acf1224a 100644 --- a/src/soundloader_type.h +++ b/src/soundloader_type.h @@ -21,7 +21,7 @@ public: ProviderManager::Register(*this); } - virtual ~SoundLoader() + ~SoundLoader() override { ProviderManager::Unregister(*this); } diff --git a/src/station_base.h b/src/station_base.h index 925d875e1e..0d38330ce0 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -553,7 +553,7 @@ public: Industry *industry = nullptr; ///< NOSAVE: Associated industry for neutral stations. (Rebuilt on load from Industry->st) Station(TileIndex tile = INVALID_TILE); - ~Station(); + ~Station() override; void AddFacility(StationFacility new_facility_bit, TileIndex facil_xy); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index c9cbd4f2ec..d257091633 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -443,7 +443,7 @@ public: this->GetWidget(WID_STL_SORTDROPBTN)->SetString(CompanyStationsWindow::sorter_names[this->stations.SortType()]); } - ~CompanyStationsWindow() + ~CompanyStationsWindow() override { /* Save filter state. */ this->filter.last_sorting = this->stations.GetListing(); diff --git a/src/train.h b/src/train.h index 0f3f954f6c..24b33d9fa9 100644 --- a/src/train.h +++ b/src/train.h @@ -107,7 +107,7 @@ struct Train final : public GroundVehicle { /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ Train() : GroundVehicleBase() {} /** We want to 'destruct' the right class. */ - virtual ~Train() { this->PreDestructor(); } + ~Train() override { this->PreDestructor(); } friend struct GroundVehicle; // GroundVehicle needs to use the acceleration functions defined at Train. diff --git a/src/vehicle_base.h b/src/vehicle_base.h index b38b3201d0..84b82976cd 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -335,7 +335,7 @@ public: void PreDestructor(); /** We want to 'destruct' the right class. */ - virtual ~Vehicle(); + ~Vehicle() override; void BeginLoading(); void CancelReservation(StationID next, Station *st); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 1e9eb0a079..7cd90cf059 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1939,7 +1939,7 @@ public: this->SortVehicleList(); } - ~VehicleListWindow() + ~VehicleListWindow() override { *this->sorting = this->vehgroups.GetListing(); } diff --git a/src/video/opengl.h b/src/video/opengl.h index 708b796a16..a31b2ace5c 100644 --- a/src/video/opengl.h +++ b/src/video/opengl.h @@ -69,7 +69,7 @@ private: std::vector cursor_sprites{}; ///< Sprites comprising cursor OpenGLBackend(); - ~OpenGLBackend(); + ~OpenGLBackend() override; std::optional Init(const Dimension &screen_res); bool InitShaders(); diff --git a/src/waypoint_base.h b/src/waypoint_base.h index cdafb1fcb8..5e56c6de39 100644 --- a/src/waypoint_base.h +++ b/src/waypoint_base.h @@ -30,7 +30,7 @@ struct Waypoint final : SpecializedStation { * @param tile The location of the waypoint. */ Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation(tile) { } - ~Waypoint(); + ~Waypoint() override; void UpdateVirtCoord() override;