1. corrected client data deletion in wxListBox (no more memory leaks in controls

sample)
2. added wxST_NO_AUTORESIZE style for wxGTK and wxMSW and added test for it to
   the controls sample


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-24 16:29:08 +00:00
parent e6ebb51430
commit 185fa6bf6f
6 changed files with 62 additions and 42 deletions

View File

@@ -359,13 +359,17 @@ void wxListBox::Clear()
void wxListBox::Free()
{
#if wxUSE_OWNER_DRAWN
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
}
if ( m_windowStyle & wxLB_OWNERDRAW )
{
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
delete m_aItems[uiCount];
}
m_aItems.Clear();
#else // !wxUSE_OWNER_DRAWN
m_aItems.Clear();
}
else
#endif // wxUSE_OWNER_DRAWN
if ( HasClientObjectData() )
{
for ( size_t n = 0; n < (size_t)m_noItems; n++ )
@@ -373,7 +377,6 @@ void wxListBox::Free()
delete GetClientObject(n);
}
}
#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
}
void wxListBox::SetSelection(int N, bool select)