Skip to content

Commit

Permalink
Fix leak when converting 2.x compositions
Browse files Browse the repository at this point in the history
(cherry-picked from 70242a)
  • Loading branch information
nyalldawson committed Mar 6, 2018
1 parent 63d587c commit fc7b99e
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 fc7b99e

Please sign in to comment.