From 453976be5e42ed143f459e57db8809727157570f Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 16 Aug 2020 12:19:40 +0100 Subject: [PATCH] Add cleanup to the new appearance widget It really should be cleaning up the heap-allocated objects it owns. --- pcbnew/widgets/appearance_controls.cpp | 6 ++++++ pcbnew/widgets/appearance_controls.h | 1 + 2 files changed, 7 insertions(+) diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 08c94c8826..e04779be36 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -189,6 +189,12 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo } +APPEARANCE_CONTROLS::~APPEARANCE_CONTROLS() +{ + delete m_iconProvider; +} + + wxSize APPEARANCE_CONTROLS::GetBestSize() const { wxSize size( 220, 480 ); diff --git a/pcbnew/widgets/appearance_controls.h b/pcbnew/widgets/appearance_controls.h index 30dfdc9f13..c8ba31c34b 100644 --- a/pcbnew/widgets/appearance_controls.h +++ b/pcbnew/widgets/appearance_controls.h @@ -90,6 +90,7 @@ public: }; APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFocusOwner, bool aFpEditor = false ); + ~APPEARANCE_CONTROLS(); wxSize GetBestSize() const;