From 8ebdf2c798e9f584954ce717ce4711e8e5707b1e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 24 May 2020 19:11:05 +0200 Subject: [PATCH] Fix disposing wxComboBox with data objects Under wxOSX the order of calls to wxItemContainer::Clear() and wxTextEntry::Clear() matters. Number of data objects to delete in wxItemContainer::Clear() is obtained by call to wxComboBox::Count(). Counter of items in wxComboBox is reset by wxTextEntry()::Clear() so this method has to be called after wxItemContainer::Clear(). Closes #18768. --- include/wx/combobox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/combobox.h b/include/wx/combobox.h index 4e9b64fdc8..35d7368c60 100644 --- a/include/wx/combobox.h +++ b/include/wx/combobox.h @@ -35,8 +35,8 @@ public: // override these methods to disambiguate between two base classes versions virtual void Clear() wxOVERRIDE { - wxTextEntry::Clear(); wxItemContainer::Clear(); + wxTextEntry::Clear(); } // IsEmpty() is ambiguous because we inherit it from both wxItemContainer