mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Fix crashes in layout manager tests
This commit is contained in:
parent
b8880d46cd
commit
be959628e5
@ -37,7 +37,7 @@ QgsLayoutManager::~QgsLayoutManager()
|
|||||||
|
|
||||||
bool QgsLayoutManager::addLayout( QgsMasterLayoutInterface *layout )
|
bool QgsLayoutManager::addLayout( QgsMasterLayoutInterface *layout )
|
||||||
{
|
{
|
||||||
if ( !layout )
|
if ( !layout || mLayouts.contains( layout ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// check for duplicate name
|
// check for duplicate name
|
||||||
@ -265,13 +265,12 @@ QgsMasterLayoutInterface *QgsLayoutManager::duplicateLayout( const QgsMasterLayo
|
|||||||
|
|
||||||
newLayout->setName( newName );
|
newLayout->setName( newName );
|
||||||
QgsMasterLayoutInterface *l = newLayout.get();
|
QgsMasterLayoutInterface *l = newLayout.get();
|
||||||
if ( !addLayout( l ) )
|
if ( !addLayout( newLayout.release() ) )
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
( void )newLayout.release(); //ownership was transferred successfully
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user