Have to implement wxPGProperty::DeleteChildren() differently so that it will work with deferred property deletion

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2010-03-01 15:30:03 +00:00
parent abf5c8a3b4
commit e4e55c061f

View File

@ -2455,10 +2455,16 @@ void wxPGProperty::DeleteChildren()
{ {
wxPropertyGridPageState* state = m_parentState; wxPropertyGridPageState* state = m_parentState;
while ( GetChildCount() ) if ( !GetChildCount() )
return;
// Because deletion is sometimes deferred, we have to use
// this sort of code for enumerating the child properties.
unsigned int i = GetChildCount();
while ( i > 0 )
{ {
wxPGProperty* child = Item(GetChildCount()-1); i--;
state->DoDelete(child, true); state->DoDelete(Item(i), true);
} }
} }