Delete DPGI's when parent DPG deleted

Ensure Gui/QGIVxx is removed when App/DVxxxx is deleted
This commit is contained in:
WandererFan
2017-01-07 11:12:17 -05:00
parent 221f80e344
commit d6419b5a7e
11 changed files with 172 additions and 61 deletions

View File

@@ -164,13 +164,15 @@ void DrawProjGroupItem::unsetupObject()
{
if (getGroup() != nullptr) {
if (getGroup()->hasProjection(Type.getValueAsString()) ) {
if (getGroup()->getAnchor() == this) {
if ((getGroup()->getAnchor() == this) &&
!getGroup()->isDeleting() ) {
Base::Console().Warning("Warning - DPG (%s/%s) may be corrupt - Anchor deleted\n",
getGroup()->getNameInDocument(),getGroup()->Label.getValue());
getGroup()->Anchor.setValue(nullptr);
}
}
}
DrawViewPart::unsetupObject();
}
PyObject *DrawProjGroupItem::getPyObject(void)