Fix crash when closing a project with layers in edition (fixes #16771)

Delete layers from project & not through layers tree, avoiding
double deletion of layers.
This commit is contained in:
Clément MARCEL 2017-08-27 07:22:13 +02:00 committed by Nyall Dawson
parent 5e945461fe
commit 37052db39a

View File

@ -492,8 +492,6 @@ void QgsProject::clear()
mMapThemeCollection.reset( new QgsMapThemeCollection( this ) );
emit mapThemeCollectionChanged();
mRootGroup->clear();
mLabelingEngineSettings->clear();
mArchive->clear();
@ -512,6 +510,8 @@ void QgsProject::clear()
writeEntry( QStringLiteral( "Measurement" ), QStringLiteral( "/AreaUnits" ), s.value( QStringLiteral( "/qgis/measure/areaunits" ) ).toString() );
removeAllMapLayers();
mRootGroup->clear();
setDirty( false );
}