X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ecaf6c1897ba205c2800f8954249c49b3f6eb937..1fd1922a49351a377bc6ef8f7e00f150112ee096:/src/mac/carbon/listbox.cpp?ds=sidebyside diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index 557d05f213..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() ; @@ -872,7 +874,9 @@ void wxListBox::OnChar(wxKeyEvent& event) } else if ( event.KeyCode() == WXK_DOWN || event.KeyCode() == WXK_UP ) { - ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; + // default handling + event.Skip() ; +// ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ; } else {