Skip to content
Permalink
Browse files

Fix crash on exit when layout designer open

  • Loading branch information
nyalldawson committed Oct 23, 2017
1 parent 332a69c commit 835653bf1b57621f4182d4afc370c23751a86bbd
Showing with 15 additions and 0 deletions.
  1. +12 −0 src/app/qgisapp.cpp
  2. +3 −0 src/app/qgisapp.h
@@ -1354,6 +1354,7 @@ QgisApp::~QgisApp()
delete mWelcomePage;

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

// cancel request for FileOpen events
@@ -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();
@@ -10361,6 +10372,7 @@ void QgisApp::closeProject()
closeAdditional3DMapCanvases();

deletePrintComposers();
deleteLayoutDesigners();
removeAnnotationItems();
// clear out any stuff from project
mMapCanvas->freeze( true );
@@ -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 );

0 comments on commit 835653b

Please sign in to comment.
You can’t perform that action at this time.