Skip to content

Commit

Permalink
Fix leak when a layout cannot be added
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 24, 2018
1 parent 6eed7de commit c1f0657
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/layout/qgslayoutmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ bool QgsLayoutManager::addLayout( QgsMasterLayoutInterface *layout )
for ( QgsMasterLayoutInterface *l : qgis::as_const( mLayouts ) )
{
if ( l->name() == layout->name() )
{
delete layout;
return false;
}
}

// ugly, but unavoidable for interfaces...
Expand Down

0 comments on commit c1f0657

Please sign in to comment.