Navigation Menu

Skip to content

Commit

Permalink
Fix crash on exit when layout designer open
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent 332a69c commit 835653b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -1354,6 +1354,7 @@ QgisApp::~QgisApp()
delete mWelcomePage;

deletePrintComposers();
deleteLayoutDesigners();
removeAnnotationItems();

// cancel request for FileOpen events
Expand Down Expand Up @@ -7361,6 +7362,16 @@ void QgisApp::deletePrintComposers()
}
}

void QgisApp::deleteLayoutDesigners()
{
// need a copy, since mLayoutDesignerDialogs will be modified as we iterate
const QSet<QgsLayoutDesignerDialog *> dialogs = mLayoutDesignerDialogs;
for ( QgsLayoutDesignerDialog *dlg : dialogs )
{
dlg->close(); // will trigger delete
}
}

void QgisApp::setupLayoutManagerConnections()
{
QgsLayoutManager *manager = QgsProject::instance()->layoutManager();
Expand Down Expand Up @@ -10361,6 +10372,7 @@ void QgisApp::closeProject()
closeAdditional3DMapCanvases();

deletePrintComposers();
deleteLayoutDesigners();
removeAnnotationItems();
// clear out any stuff from project
mMapCanvas->freeze( true );
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgisapp.h
Expand Up @@ -1712,6 +1712,9 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! Deletes all the composer objects and clears mPrintComposers
void deletePrintComposers();

//! Deletes all the layout designer windows
void deleteLayoutDesigners();

void setupLayoutManagerConnections();

void setupAtlasMapLayerAction( QgsComposition *composition, bool enableAction );
Expand Down

0 comments on commit 835653b

Please sign in to comment.