Skip to content
Permalink
Browse files

Merge pull request #38593 from nyalldawson/fix_annotation_layer_crash

Fix crash when creating project and default transform context has some entries
  • Loading branch information
elpaso committed Sep 4, 2020
2 parents badbdb3 + eb68eb7 commit 79fb7569350f3c10b0891fbd412f94a2a2c5d1ec
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/core/qgsproject.cpp
@@ -376,6 +376,10 @@ QgsProject::QgsProject( QObject *parent )
, mAuxiliaryStorage( new QgsAuxiliaryStorage() )
{
mProperties.setName( QStringLiteral( "properties" ) );

mMainAnnotationLayer = new QgsAnnotationLayer( QObject::tr( "Annotations" ), QgsAnnotationLayer::LayerOptions( mTransformContext ) );
mMainAnnotationLayer->setParent( this );

clear();

// bind the layer tree to the map layer registry.
@@ -433,9 +437,6 @@ QgsProject::QgsProject( QObject *parent )
Q_NOWARN_DEPRECATED_PUSH
connect( mViewSettings, &QgsProjectViewSettings::mapScalesChanged, this, &QgsProject::mapScalesChanged );
Q_NOWARN_DEPRECATED_POP

mMainAnnotationLayer = new QgsAnnotationLayer( QObject::tr( "Annotations" ), QgsAnnotationLayer::LayerOptions( mTransformContext ) );
mMainAnnotationLayer->setParent( this );
}


0 comments on commit 79fb756

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