From: Vadim Zeitlin Date: Sat, 5 Nov 2011 11:23:57 +0000 (+0000) Subject: Fix adding a control to two different sizers in the widgets sample. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3a6b6a98895b14b5edf1aab8d258e306ab764977 Fix adding a control to two different sizers in the widgets sample. A checkbox on the static page was added to two sizers at once, resulting in heap corruption later. Fix this by adding it to the right sizer only. Closes #13619. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index a2a363c6d5..65dd5e4c61 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -326,10 +326,8 @@ void StaticWidgetsPage::CreateContent() sizerMiddle->Add(m_textLabelWithMarkup, 0, wxEXPAND|wxALL, 5); sizerMiddle->Add(b3, 0, wxLEFT|wxBOTTOM, 5); - m_chkGreen = CreateCheckBoxAndAddToSizer(sizerLeft, + m_chkGreen = CreateCheckBoxAndAddToSizer(sizerMiddle, "Decorated label on g&reen"); - - sizerMiddle->Add(m_chkGreen, 0, wxALL, 5); #endif // wxUSE_MARKUP // final initializations