First check whether it is attempted to delete the root property
Because wxPGRootProperty has no parent, just like an unattached (waiting for deletion) child wxPGProperty, so we have to first check whether the property is the root and next whether it has a parent.
This commit is contained in:
@@ -1839,12 +1839,12 @@ bool wxPropertyGridPageState::IsChildCategory(wxPGProperty* p,
|
|||||||
|
|
||||||
void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
|
void wxPropertyGridPageState::DoDelete( wxPGProperty* item, bool doDelete )
|
||||||
{
|
{
|
||||||
|
wxCHECK_RET(item != &m_regularArray && item != m_abcArray,
|
||||||
|
wxS("wxPropertyGrid: Do not attempt to remove the root item."));
|
||||||
|
|
||||||
wxCHECK_RET( item->GetParent(),
|
wxCHECK_RET( item->GetParent(),
|
||||||
wxS("wxPropertyGrid: This property was already deleted.") );
|
wxS("wxPropertyGrid: This property was already deleted.") );
|
||||||
|
|
||||||
wxCHECK_RET( item != &m_regularArray && item != m_abcArray,
|
|
||||||
wxS("wxPropertyGrid: Do not attempt to remove the root item.") );
|
|
||||||
|
|
||||||
wxPGProperty* parent = item->GetParent();
|
wxPGProperty* parent = item->GetParent();
|
||||||
|
|
||||||
wxCHECK_RET( !parent->HasFlag(wxPG_PROP_AGGREGATE),
|
wxCHECK_RET( !parent->HasFlag(wxPG_PROP_AGGREGATE),
|
||||||
|
|||||||
Reference in New Issue
Block a user