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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user