From: Vadim Zeitlin Date: Sun, 12 Feb 2006 12:54:19 +0000 (+0000) Subject: fixed memory leak in the sample and simplified wxCheckListBox creation code X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9002a61c32b8b84ff31491a5ef3781f08292d681 fixed memory leak in the sample and simplified wxCheckListBox creation code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/wizard/wizard.cpp b/samples/wizard/wizard.cpp index 7a96e19214..a77af4a31d 100644 --- a/samples/wizard/wizard.cpp +++ b/samples/wizard/wizard.cpp @@ -264,14 +264,27 @@ public: #if wxUSE_CHECKLISTBOX static const wxChar *aszChoices[] = - { _T("Zeroth"), _T("First"), _T("Second"), _T("Third"), _T("Fourth"), _T("Fifth"), _T("Sixth"), _T("Seventh"), _T("Eighth"), _T("Nineth") }; - wxString *astrChoices = new wxString[WXSIZEOF(aszChoices)]; - unsigned int ui; - for ( ui = 0; ui < WXSIZEOF(aszChoices); ui++ ) - astrChoices[ui] = aszChoices[ui]; - - m_checklistbox = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxSize(100,100), - WXSIZEOF(aszChoices), astrChoices); + { + _T("Zeroth"), + _T("First"), + _T("Second"), + _T("Third"), + _T("Fourth"), + _T("Fifth"), + _T("Sixth"), + _T("Seventh"), + _T("Eighth"), + _T("Nineth") + }; + + m_checklistbox = new wxCheckListBox + ( + this, + wxID_ANY, + wxDefaultPosition, + wxSize(100,100), + wxArrayString(WXSIZEOF(aszChoices), aszChoices) + ); mainSizer->Add( m_checklistbox,