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
  • Loading branch information
nyalldawson committed Oct 3, 2023
1 parent 4d9f3f8 commit d2ee3eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -118,6 +118,7 @@
#include "options/qgsrenderingoptions.h"
#include "options/qgsvectorrenderingoptions.h"
#include "options/qgsuserprofileoptions.h"
#include "qgsbrowserdockwidget_p.h"

#include "raster/qgsrasterelevationpropertieswidget.h"
#include "qgsrasterattributetableapputils.h"
Expand Down Expand Up @@ -2152,6 +2153,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 d2ee3eb

Please sign in to comment.