Fix #3224 Seg Fault in DrawProjGroup

- QGIViews for DrawProjGroupItem were not being deleted since
  DPGI belongs to DPG, not DrawPage.  Since there is a 1 to 1
  relationship between MDIViewPage and DrawPage, the check for
  membership in DrawPage is unnecessary.
This commit is contained in:
WandererFan
2017-11-24 19:59:12 -05:00
parent 56f07de8ad
commit 58e8cefc56
3 changed files with 6 additions and 11 deletions

View File

@@ -339,14 +339,9 @@ bool MDIViewPage::attachView(App::DocumentObject *obj)
void MDIViewPage::onDeleteObject(const App::DocumentObject& obj)
{
//if this page has a QView for this obj, delete it.
if (obj.isDerivedFrom(TechDraw::DrawView::getClassTypeId())) {
const App::DocumentObject* objPtr = &obj;
const TechDraw::DrawView* dv = static_cast<const TechDraw::DrawView*>(objPtr);
TechDraw::DrawPage* dvPg = dv->findParentPage();
if (dvPg == m_vpPage->getDrawPage()) {
//this is a DV that is on our page
(void) m_view->removeQViewByDrawView(dv);
}
(void) m_view->removeQViewByName(obj.getNameInDocument());
}
}