]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed memory leak in the sample and simplified wxCheckListBox creation code
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 12 Feb 2006 12:54:19 +0000 (12:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 12 Feb 2006 12:54:19 +0000 (12:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/wizard/wizard.cpp

index 7a96e19214d60be29dfb520ea8fab92513872a4d..a77af4a31d0e00259026508c9337085a2cb27ace 100644 (file)
@@ -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,