From b47a6e415b66c9de4c3604e1225919692389b6d5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 23 Mar 2017 16:52:05 +0100 Subject: [PATCH] Fixed a memleak in DIALOG_CHOOSE_COMPONENT --- eeschema/dialogs/dialog_choose_component.cpp | 11 +++++++++++ eeschema/dialogs/dialog_choose_component.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp index 0f6e4cdae4..dab4e2de23 100644 --- a/eeschema/dialogs/dialog_choose_component.cpp +++ b/eeschema/dialogs/dialog_choose_component.cpp @@ -104,6 +104,17 @@ DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT( } +DIALOG_CHOOSE_COMPONENT::~DIALOG_CHOOSE_COMPONENT() +{ + // I am not sure the following two lines are necessary, + // but they will not hurt anyone + m_dbl_click_timer->Stop(); + Unbind( wxEVT_TIMER, &DIALOG_CHOOSE_COMPONENT::OnCloseTimer, this ); + + delete m_dbl_click_timer; +} + + wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructLeftPanel( wxWindow* aParent ) { auto panel = new wxPanel( aParent ); diff --git a/eeschema/dialogs/dialog_choose_component.h b/eeschema/dialogs/dialog_choose_component.h index d0aee6945e..6af8869ac3 100644 --- a/eeschema/dialogs/dialog_choose_component.h +++ b/eeschema/dialogs/dialog_choose_component.h @@ -97,6 +97,8 @@ public: CMP_TREE_MODEL_ADAPTER::PTR& aAdapter, int aDeMorganConvert ); + ~DIALOG_CHOOSE_COMPONENT(); + /** Function GetSelectedAlias * To be called after this dialog returns from ShowModal(). *