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 7de79e7997
commit 447d4816ce
3 changed files with 6 additions and 11 deletions

View File

@@ -217,14 +217,14 @@ int QGVPage::removeQView(QGIView *view)
return 0;
}
int QGVPage::removeQViewByDrawView(const TechDraw::DrawView* dv)
int QGVPage::removeQViewByName(const char* name)
{
std::vector<QGIView*> items = getViews();
QString qsName = QString::fromUtf8(dv->getNameInDocument());
QString qsName = QString::fromUtf8(name);
bool found = false;
QGIView* ourItem = nullptr;
for (auto& i:items) {
if (qsName == i->data(1).toString()) { //is there really a QGIV for this DV in scene?
if (qsName == i->data(1).toString()) { //is there a QGIV with this name in scene?
found = true;
ourItem = i;
break;