From 3661975bf8634530eca23d53cdb5db41d13b207c Mon Sep 17 00:00:00 2001 From: Kvaz1r Date: Sun, 5 Jun 2022 13:41:46 +0300 Subject: [PATCH] Fix memory leak in wxListBox destructor in wxUniv wxItemContainer::Clear() must be called to actually free the client data, and not just DoClear() (which will be called by the base class Clear() too). Closes #22489. --- src/univ/listbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index 350f10633b..25f1eece1c 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -197,7 +197,7 @@ bool wxListBox::Create(wxWindow *parent, wxListBox::~wxListBox() { // call this just to free the client data -- and avoid leaking memory - DoClear(); + Clear(); if ( IsSorted() ) delete m_strings.sorted;