Skip to content

Commit

Permalink
Fix leak when converting 2.x compositions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 2, 2018
1 parent 55814b8 commit 70242a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/layout/qgscompositionconverter.cpp
Expand Up @@ -142,9 +142,9 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo
QgsReadWriteContext context;
if ( project )
context.setPathResolver( project->pathResolver() );
QgsFillSymbol *symbol = QgsSymbolLayerUtils::loadSymbol<QgsFillSymbol>( symbolElement, context );
std::unique_ptr< QgsFillSymbol > symbol( QgsSymbolLayerUtils::loadSymbol<QgsFillSymbol>( symbolElement, context ) );
if ( symbol )
layout->pageCollection()->setPageStyleSymbol( symbol );
layout->pageCollection()->setPageStyleSymbol( symbol.get() );
}

QString name = composerElement.attribute( QStringLiteral( "name" ) );
Expand Down

0 comments on commit 70242a3

Please sign in to comment.