Skip to content

Commit

Permalink
[TD]fix crash in Preferences
Browse files Browse the repository at this point in the history
- QGVPage was not detaching the parameter observer when
  deleted, leaving a stale pointer in the list of observers.
  • Loading branch information
WandererFan committed Aug 27, 2022
1 parent 51678cc commit dd95969
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/TechDraw/Gui/QGVPage.cpp
Expand Up @@ -225,6 +225,11 @@ class QGVPage::Private : public ParameterGrp::ObserverType {
}
}
}
void detach() {
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View");
hGrp->Detach(this);

}
};

QGVPage::QGVPage(ViewProviderPage *vp, QGSPage* s, QWidget *parent)
Expand Down Expand Up @@ -285,6 +290,7 @@ QGVPage::~QGVPage()
{
delete bkgBrush;
delete m_navStyle;
d->detach();
}

void QGVPage::centerOnPage(void)
Expand Down

0 comments on commit dd95969

Please sign in to comment.