From: Jaakko Salli Date: Thu, 4 Mar 2010 15:09:15 +0000 (+0000) Subject: Moved property unattachment code from wxPropertyGridInterface::RemoveProperty() to... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2ac06991a797c3a97e47f1f1f3ca313e17c78a10 Moved property unattachment code from wxPropertyGridInterface::RemoveProperty() to wxPropertyGridPageState::DoDelete() - fixes deferred removal issue git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 99bf2dd80c..d29e2f4498 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -166,10 +166,6 @@ wxPGProperty* wxPropertyGridInterface::RemoveProperty( wxPGPropArg id ) state->DoDelete( p, false ); - // Mark the property as 'unattached' - p->m_parentState = NULL; - p->m_parent = NULL; - RefreshGrid(state); return p; diff --git a/src/propgrid/propgridpagestate.cpp b/src/propgrid/propgridpagestate.cpp index fa771dc7f1..cf059678a0 100644 --- a/src/propgrid/propgridpagestate.cpp +++ b/src/propgrid/propgridpagestate.cpp @@ -1979,6 +1979,10 @@ void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete ) if ( pg && pg->m_propHover == item ) pg->m_propHover = NULL; + // Mark the property as 'unattached' + item->m_parentState = NULL; + item->m_parent = NULL; + // We can actually delete it now if ( doDelete ) delete item;