From 74bbdca25fc71699d7f1cbdbf003ea9c5809a03c Mon Sep 17 00:00:00 2001 From: Itms Date: Sun, 10 Aug 2025 22:25:06 +0200 Subject: [PATCH] Remove default dtors of IGUIObject derived classes --- source/gui/ObjectTypes/CButton.cpp | 4 ---- source/gui/ObjectTypes/CButton.h | 1 - source/gui/ObjectTypes/CChart.cpp | 6 +----- source/gui/ObjectTypes/CChart.h | 3 +-- source/gui/ObjectTypes/CCheckBox.cpp | 6 +----- source/gui/ObjectTypes/CCheckBox.h | 3 +-- source/gui/ObjectTypes/CDropDown.cpp | 6 +----- source/gui/ObjectTypes/CDropDown.h | 3 +-- source/gui/ObjectTypes/CHotkeyPicker.cpp | 6 +----- source/gui/ObjectTypes/CHotkeyPicker.h | 1 - source/gui/ObjectTypes/CImage.cpp | 6 +----- source/gui/ObjectTypes/CImage.h | 3 +-- source/gui/ObjectTypes/CInput.cpp | 4 ---- source/gui/ObjectTypes/CInput.h | 3 +-- source/gui/ObjectTypes/CList.cpp | 6 +----- source/gui/ObjectTypes/CList.h | 3 +-- source/gui/ObjectTypes/CMiniMap.cpp | 2 -- source/gui/ObjectTypes/CMiniMap.h | 1 - source/gui/ObjectTypes/CProgressBar.cpp | 6 +----- source/gui/ObjectTypes/CProgressBar.h | 3 +-- source/gui/ObjectTypes/CScrollPanel.cpp | 6 +----- source/gui/ObjectTypes/CScrollPanel.h | 3 +-- source/gui/ObjectTypes/CSlider.cpp | 4 ---- source/gui/ObjectTypes/CSlider.h | 3 +-- source/gui/ObjectTypes/CText.cpp | 4 ---- source/gui/ObjectTypes/CText.h | 1 - source/gui/ObjectTypes/CTooltip.cpp | 6 +----- source/gui/ObjectTypes/CTooltip.h | 3 +-- 28 files changed, 19 insertions(+), 87 deletions(-) diff --git a/source/gui/ObjectTypes/CButton.cpp b/source/gui/ObjectTypes/CButton.cpp index 5b200b5bf0..85a9af2143 100644 --- a/source/gui/ObjectTypes/CButton.cpp +++ b/source/gui/ObjectTypes/CButton.cpp @@ -48,10 +48,6 @@ CButton::CButton(CGUI& pGUI) AddText(); } -CButton::~CButton() -{ -} - void CButton::SetupText() { ENSURE(m_GeneratedTexts.size() == 1); diff --git a/source/gui/ObjectTypes/CButton.h b/source/gui/ObjectTypes/CButton.h index 8bb97e18d7..efea1ddb1b 100644 --- a/source/gui/ObjectTypes/CButton.h +++ b/source/gui/ObjectTypes/CButton.h @@ -37,7 +37,6 @@ class CButton : public IGUIObject, public IGUITextOwner, public IGUIButtonBehavi GUI_OBJECT(CButton) public: CButton(CGUI& pGUI); - virtual ~CButton(); /** * @see IGUIObject#ResetStates() diff --git a/source/gui/ObjectTypes/CChart.cpp b/source/gui/ObjectTypes/CChart.cpp index 45854d19ef..930e39db18 100644 --- a/source/gui/ObjectTypes/CChart.cpp +++ b/source/gui/ObjectTypes/CChart.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -53,10 +53,6 @@ CChart::CChart(CGUI& pGUI) { } -CChart::~CChart() -{ -} - void CChart::UpdateCachedSize() { IGUIObject::UpdateCachedSize(); diff --git a/source/gui/ObjectTypes/CChart.h b/source/gui/ObjectTypes/CChart.h index b24e4e8406..9e3fc2000f 100644 --- a/source/gui/ObjectTypes/CChart.h +++ b/source/gui/ObjectTypes/CChart.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -55,7 +55,6 @@ class CChart : public IGUIObject, public IGUITextOwner public: CChart(CGUI& pGUI); - virtual ~CChart(); protected: /** diff --git a/source/gui/ObjectTypes/CCheckBox.cpp b/source/gui/ObjectTypes/CCheckBox.cpp index ae2da3e304..1a686c9d6e 100644 --- a/source/gui/ObjectTypes/CCheckBox.cpp +++ b/source/gui/ObjectTypes/CCheckBox.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -38,10 +38,6 @@ CCheckBox::CCheckBox(CGUI& pGUI) { } -CCheckBox::~CCheckBox() -{ -} - void CCheckBox::ResetStates() { IGUIObject::ResetStates(); diff --git a/source/gui/ObjectTypes/CCheckBox.h b/source/gui/ObjectTypes/CCheckBox.h index 92e0877850..84ed6175c8 100644 --- a/source/gui/ObjectTypes/CCheckBox.h +++ b/source/gui/ObjectTypes/CCheckBox.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -31,7 +31,6 @@ class CCheckBox : public IGUIObject, public IGUIButtonBehavior public: CCheckBox(CGUI& pGUI); - virtual ~CCheckBox(); /** * @see IGUIObject#ResetStates() diff --git a/source/gui/ObjectTypes/CDropDown.cpp b/source/gui/ObjectTypes/CDropDown.cpp index b80acc868d..19e8066a83 100644 --- a/source/gui/ObjectTypes/CDropDown.cpp +++ b/source/gui/ObjectTypes/CDropDown.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -65,10 +65,6 @@ CDropDown::CDropDown(CGUI& pGUI) m_ScrollBar.Set(true, true); } -CDropDown::~CDropDown() -{ -} - void CDropDown::SetupText() { SetupListRect(); diff --git a/source/gui/ObjectTypes/CDropDown.h b/source/gui/ObjectTypes/CDropDown.h index ab20597447..9aa2f87966 100644 --- a/source/gui/ObjectTypes/CDropDown.h +++ b/source/gui/ObjectTypes/CDropDown.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -58,7 +58,6 @@ class CDropDown : public CList public: CDropDown(CGUI& pGUI); - virtual ~CDropDown(); /** * @see IGUIObject#HandleMessage() diff --git a/source/gui/ObjectTypes/CHotkeyPicker.cpp b/source/gui/ObjectTypes/CHotkeyPicker.cpp index 8d60c28a6e..01f4beb167 100644 --- a/source/gui/ObjectTypes/CHotkeyPicker.cpp +++ b/source/gui/ObjectTypes/CHotkeyPicker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -63,10 +63,6 @@ CHotkeyPicker::CHotkeyPicker(CGUI& pGUI) : IGUIObject(pGUI), m_TimeToCombination m_KeysPressed.reserve(8); } -CHotkeyPicker::~CHotkeyPicker() -{ -} - void CHotkeyPicker::FireEvent(const CStr& event) { ScriptRequest rq(*m_pGUI.GetScriptInterface()); diff --git a/source/gui/ObjectTypes/CHotkeyPicker.h b/source/gui/ObjectTypes/CHotkeyPicker.h index f5e39c5616..0fb81796d0 100644 --- a/source/gui/ObjectTypes/CHotkeyPicker.h +++ b/source/gui/ObjectTypes/CHotkeyPicker.h @@ -41,7 +41,6 @@ class CHotkeyPicker : public IGUIObject public: CHotkeyPicker(CGUI& pGUI); - virtual ~CHotkeyPicker(); // Do nothing. virtual void Draw(CCanvas2D&) {}; diff --git a/source/gui/ObjectTypes/CImage.cpp b/source/gui/ObjectTypes/CImage.cpp index 7493457c03..f9466c3e7f 100644 --- a/source/gui/ObjectTypes/CImage.cpp +++ b/source/gui/ObjectTypes/CImage.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -28,10 +28,6 @@ CImage::CImage(CGUI& pGUI) { } -CImage::~CImage() -{ -} - void CImage::Draw(CCanvas2D& canvas) { m_pGUI.DrawSprite(m_Sprite, canvas, m_CachedActualSize, m_VisibleArea); diff --git a/source/gui/ObjectTypes/CImage.h b/source/gui/ObjectTypes/CImage.h index 03e0b10882..52ba1ed11e 100644 --- a/source/gui/ObjectTypes/CImage.h +++ b/source/gui/ObjectTypes/CImage.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -40,7 +40,6 @@ class CImage : public IGUIObject public: CImage(CGUI& pGUI); - virtual ~CImage(); protected: /** diff --git a/source/gui/ObjectTypes/CInput.cpp b/source/gui/ObjectTypes/CInput.cpp index 466657637e..213b668da1 100644 --- a/source/gui/ObjectTypes/CInput.cpp +++ b/source/gui/ObjectTypes/CInput.cpp @@ -101,10 +101,6 @@ CInput::CInput(CGUI& pGUI) AddScrollBar(std::move(bar)); } -CInput::~CInput() -{ -} - void CInput::UpdateBufferPositionSetting() { m_BufferPosition.Set(m_iBufferPos, false); diff --git a/source/gui/ObjectTypes/CInput.h b/source/gui/ObjectTypes/CInput.h index 85dbc57e86..4faffe94ff 100644 --- a/source/gui/ObjectTypes/CInput.h +++ b/source/gui/ObjectTypes/CInput.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -54,7 +54,6 @@ protected: // forwards public: CInput(CGUI& pGUI); - virtual ~CInput(); /** * @see IGUIObject#ResetStates() diff --git a/source/gui/ObjectTypes/CList.cpp b/source/gui/ObjectTypes/CList.cpp index 2954ef7141..8a1d454148 100644 --- a/source/gui/ObjectTypes/CList.cpp +++ b/source/gui/ObjectTypes/CList.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -81,10 +81,6 @@ CList::CList(CGUI& pGUI) AddScrollBar(std::move(bar)); } -CList::~CList() -{ -} - void CList::SetupText() { SetupText(false); diff --git a/source/gui/ObjectTypes/CList.h b/source/gui/ObjectTypes/CList.h index c915181c08..ee58badbab 100644 --- a/source/gui/ObjectTypes/CList.h +++ b/source/gui/ObjectTypes/CList.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -50,7 +50,6 @@ class CList : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner GUI_OBJECT(CList) public: CList(CGUI& pGUI); - virtual ~CList(); /** * @see IGUIObject#ResetStates() diff --git a/source/gui/ObjectTypes/CMiniMap.cpp b/source/gui/ObjectTypes/CMiniMap.cpp index 845e9f967b..72e61f08f4 100644 --- a/source/gui/ObjectTypes/CMiniMap.cpp +++ b/source/gui/ObjectTypes/CMiniMap.cpp @@ -119,8 +119,6 @@ CMiniMap::CMiniMap(CGUI& pGUI) : m_MouseHovering = false; } -CMiniMap::~CMiniMap() = default; - void CMiniMap::HandleMessage(SGUIMessage& Message) { IGUIObject::HandleMessage(Message); diff --git a/source/gui/ObjectTypes/CMiniMap.h b/source/gui/ObjectTypes/CMiniMap.h index d75566c6be..b9e96ab63d 100644 --- a/source/gui/ObjectTypes/CMiniMap.h +++ b/source/gui/ObjectTypes/CMiniMap.h @@ -41,7 +41,6 @@ class CMiniMap : public IGUIObject public: CMiniMap(CGUI& pGUI); - virtual ~CMiniMap(); bool Flare(const CVector2D& pos, const CStr& colorStr); diff --git a/source/gui/ObjectTypes/CProgressBar.cpp b/source/gui/ObjectTypes/CProgressBar.cpp index afafd3af27..764da5e119 100644 --- a/source/gui/ObjectTypes/CProgressBar.cpp +++ b/source/gui/ObjectTypes/CProgressBar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -34,10 +34,6 @@ CProgressBar::CProgressBar(CGUI& pGUI) { } -CProgressBar::~CProgressBar() -{ -} - void CProgressBar::HandleMessage(SGUIMessage& Message) { IGUIObject::HandleMessage(Message); diff --git a/source/gui/ObjectTypes/CProgressBar.h b/source/gui/ObjectTypes/CProgressBar.h index d7703b1d35..61aabc39e8 100644 --- a/source/gui/ObjectTypes/CProgressBar.h +++ b/source/gui/ObjectTypes/CProgressBar.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -33,7 +33,6 @@ class CProgressBar : public IGUIObject public: CProgressBar(CGUI& pGUI); - virtual ~CProgressBar(); protected: /** diff --git a/source/gui/ObjectTypes/CScrollPanel.cpp b/source/gui/ObjectTypes/CScrollPanel.cpp index 0b34fbe9f3..91540f8c98 100644 --- a/source/gui/ObjectTypes/CScrollPanel.cpp +++ b/source/gui/ObjectTypes/CScrollPanel.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -50,10 +50,6 @@ CScrollPanel::CScrollPanel(CGUI& pGUI) AddScrollBar(std::move(hbar)); } -CScrollPanel::~CScrollPanel() -{ -} - void CScrollPanel::ResetStates() { IGUIPanel::ResetStates(); diff --git a/source/gui/ObjectTypes/CScrollPanel.h b/source/gui/ObjectTypes/CScrollPanel.h index 2a39aa09af..a86fb78d80 100644 --- a/source/gui/ObjectTypes/CScrollPanel.h +++ b/source/gui/ObjectTypes/CScrollPanel.h @@ -1,4 +1,4 @@ -/* Copyright (C) 20244 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -35,7 +35,6 @@ class CScrollPanel : public IGUIPanel, public IGUIScrollBarOwner mutable std::vector m_ModifiedChildren; // To store the modified vector public: CScrollPanel(CGUI& pGUI); - virtual ~CScrollPanel(); virtual void UpdateCachedSize(); virtual void ResetStates(); diff --git a/source/gui/ObjectTypes/CSlider.cpp b/source/gui/ObjectTypes/CSlider.cpp index f68ed25c74..4847e339b8 100644 --- a/source/gui/ObjectTypes/CSlider.cpp +++ b/source/gui/ObjectTypes/CSlider.cpp @@ -41,10 +41,6 @@ CSlider::CSlider(CGUI& pGUI) m_Value.Set(Clamp(m_Value, m_MinValue, m_MaxValue), false); } -CSlider::~CSlider() -{ -} - void CSlider::ResetStates() { IGUIObject::ResetStates(); diff --git a/source/gui/ObjectTypes/CSlider.h b/source/gui/ObjectTypes/CSlider.h index 87c47c6d8b..0a42a69575 100644 --- a/source/gui/ObjectTypes/CSlider.h +++ b/source/gui/ObjectTypes/CSlider.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -34,7 +34,6 @@ class CSlider : public IGUIObject, public IGUIButtonBehavior public: CSlider(CGUI& pGUI); - virtual ~CSlider(); protected: static const CStr EventNameValueChange; diff --git a/source/gui/ObjectTypes/CText.cpp b/source/gui/ObjectTypes/CText.cpp index 6a67dfeffb..128224debc 100644 --- a/source/gui/ObjectTypes/CText.cpp +++ b/source/gui/ObjectTypes/CText.cpp @@ -58,10 +58,6 @@ CText::CText(CGUI& pGUI) AddText(); } -CText::~CText() -{ -} - void CText::SetupText() { if (m_GeneratedTexts.empty()) diff --git a/source/gui/ObjectTypes/CText.h b/source/gui/ObjectTypes/CText.h index bdaaf6fc90..af04c58ae4 100644 --- a/source/gui/ObjectTypes/CText.h +++ b/source/gui/ObjectTypes/CText.h @@ -39,7 +39,6 @@ class CText : public IGUIObject, public IGUIScrollBarOwner, public IGUITextOwner GUI_OBJECT(CText) public: CText(CGUI& pGUI); - virtual ~CText(); /** * @see IGUIObject#ResetStates() diff --git a/source/gui/ObjectTypes/CTooltip.cpp b/source/gui/ObjectTypes/CTooltip.cpp index 9ae769f6e3..a3a2073ac0 100644 --- a/source/gui/ObjectTypes/CTooltip.cpp +++ b/source/gui/ObjectTypes/CTooltip.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -57,10 +57,6 @@ CTooltip::CTooltip(CGUI& pGUI) AddText(); } -CTooltip::~CTooltip() -{ -} - void CTooltip::SetupText() { ENSURE(m_GeneratedTexts.size() == 1); diff --git a/source/gui/ObjectTypes/CTooltip.h b/source/gui/ObjectTypes/CTooltip.h index 9fec951582..dc804ea99d 100644 --- a/source/gui/ObjectTypes/CTooltip.h +++ b/source/gui/ObjectTypes/CTooltip.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -40,7 +40,6 @@ class CTooltip : public IGUIObject, public IGUITextOwner public: CTooltip(CGUI& pGUI); - virtual ~CTooltip(); const CStr& GetUsedObject() const { return m_UseObject; } i32 GetTooltipDelay() const { return m_Delay; }