X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f11afffe0185c11de54b886f6fe7b18272635d9a..0c32c93044babd3315029af529ab4348b103b036:/src/mac/carbon/listbox.cpp diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 2d8471f00e..f4ddc539b3 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -246,7 +246,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, wxListBox::~wxListBox() { - Free() ; + FreeData() ; if ( m_macList ) { #if !TARGET_CARBON @@ -257,7 +257,7 @@ wxListBox::~wxListBox() } } -void wxListBox::Free() +void wxListBox::FreeData() { #if wxUSE_OWNER_DRAWN if ( m_windowStyle & wxLB_OWNERDRAW ) @@ -265,6 +265,7 @@ void wxListBox::Free() size_t uiCount = m_aItems.Count(); while ( uiCount-- != 0 ) { delete m_aItems[uiCount]; + m_aItems[uiCount] = NULL; } m_aItems.Clear(); @@ -373,6 +374,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData) size_t ui = m_aItems.Count(); while ( ui-- != 0 ) { delete m_aItems[ui]; + m_aItems[ui] = NULL; } m_aItems.Empty(); @@ -466,7 +468,7 @@ int wxListBox::FindString(const wxString& st) const void wxListBox::Clear() { - Free(); + FreeData(); m_noItems = 0; m_stringArray.Empty() ; m_dataArray.Empty() ;