Skip to content
Permalink
Browse files

Fix crashes in layout manager tests

  • Loading branch information
nyalldawson committed Jan 24, 2018
1 parent b8880d4 commit be959628e5c8ebe7be395294430ad95c1260d34b
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/layout/qgslayoutmanager.cpp
@@ -37,7 +37,7 @@ QgsLayoutManager::~QgsLayoutManager()

bool QgsLayoutManager::addLayout( QgsMasterLayoutInterface *layout )
{
if ( !layout )
if ( !layout || mLayouts.contains( layout ) )
return false;

// check for duplicate name
@@ -265,13 +265,12 @@ QgsMasterLayoutInterface *QgsLayoutManager::duplicateLayout( const QgsMasterLayo

newLayout->setName( newName );
QgsMasterLayoutInterface *l = newLayout.get();
if ( !addLayout( l ) )
if ( !addLayout( newLayout.release() ) )
{
return nullptr;
}
else
{
( void )newLayout.release(); //ownership was transferred successfully
return l;
}
}

0 comments on commit be95962

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