Skip to content

Commit

Permalink
Merge pull request #38593 from nyalldawson/fix_annotation_layer_crash
Browse files Browse the repository at this point in the history
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 79fb756
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/qgsproject.cpp
Expand Up @@ -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.
Expand Down Expand Up @@ -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 );
}


Expand Down

0 comments on commit 79fb756

Please sign in to comment.