From fd9d67e9f4afb3659974c5760e49403f47ca47d2 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 25 Oct 2014 12:35:14 +0000 Subject: [PATCH] Get wxPGProperty items to be deleted with deferral directly from the corresponding internal list of items. Don't use iterator to collect wxPGProperty items in wxPropertyGridPageState::DoClear(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgridpagestate.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index e36660a7d8..cc58ff3b8a 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -290,16 +290,10 @@ void wxPropertyGridPageState::DoClear() // deleted individually (and with deferral). if ( m_pPropGrid && m_pPropGrid->m_processedEvent ) { - wxPropertyGridIterator it; - for ( it = wxPropertyGridIterator(this, wxPG_ITERATE_ALL, wxNullProperty); - !it.AtEnd(); - it++ ) + for (unsigned int i = 0; i < m_regularArray.GetChildCount(); i++) { - wxPGProperty *p = *it; - // Do not attempt to explicitly remove sub-properties. - // They will be removed in their parent property dtor. - if ( !p->GetParent()->HasFlag(wxPG_PROP_AGGREGATE) ) - DoDelete(p, true); + wxPGProperty* p = m_regularArray.Item(i); + DoDelete(p, true); } } else