Skip to content

Commit

Permalink
Fix #2971 segfault on hide() current page from Python
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan authored and wwmayer committed May 10, 2017
1 parent 5a0f53d commit 36960df
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Mod/TechDraw/Gui/ViewProviderPage.cpp
Expand Up @@ -116,18 +116,17 @@ void ViewProviderPage::show(void)

void ViewProviderPage::hide(void)
{
// hiding the drawing page should not affect its children but closes the MDI m_mdiView
// therefore do not call the method of its direct base class
ViewProviderDocumentObject::hide();
if (m_mdiView) {
m_mdiView->parentWidget()->deleteLater();
if (!m_mdiView.isNull()) { //m_mdiView is a QPointer
Gui::getMainWindow()->activatePreviousWindow();
Gui::getMainWindow()->removeWindow(m_mdiView);
}
ViewProviderDocumentObject::hide();
}

void ViewProviderPage::updateData(const App::Property* prop)
{
if (prop == &(getDrawPage()->Views)) {
if(m_mdiView &&
if(!m_mdiView.isNull() &&
!getDrawPage()->isDeleting()) {
m_mdiView->updateDrawing();
}
Expand Down

0 comments on commit 36960df

Please sign in to comment.