Skip to content

Commit

Permalink
Cleanup all browser layer properties dialog before exiting (#54808)
Browse files Browse the repository at this point in the history
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes #39094

(cherry picked from commit d2ee3eb)
  • Loading branch information
nyalldawson committed Oct 6, 2023
1 parent a16d558 commit e539502
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -116,6 +116,7 @@
#include "options/qgsrasterrenderingoptions.h"
#include "options/qgsrenderingoptions.h"
#include "options/qgsvectorrenderingoptions.h"
#include "qgsbrowserdockwidget_p.h"

#include "raster/qgsrasterelevationpropertieswidget.h"
#include "vector/qgsvectorelevationpropertieswidget.h"
Expand Down Expand Up @@ -1982,6 +1983,13 @@ QgisApp::~QgisApp()
deleteLayoutDesigners();
removeAnnotationItems();

// these need to be gracefully cleaned up before QgsApplication::exitQgis()
const QList<QgsBrowserPropertiesDialog *> browserPropertyDialogs = findChildren< QgsBrowserPropertiesDialog * >();
for ( QgsBrowserPropertiesDialog *widget : browserPropertyDialogs )
{
delete widget;
}

// cancel request for FileOpen events
QgsApplication::setFileOpenEventReceiver( nullptr );

Expand Down

0 comments on commit e539502

Please sign in to comment.