Skip to content

Commit 70242a3

Browse files
committed
Fix leak when converting 2.x compositions
1 parent 55814b8 commit 70242a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/layout/qgscompositionconverter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo
142142
QgsReadWriteContext context;
143143
if ( project )
144144
context.setPathResolver( project->pathResolver() );
145-
QgsFillSymbol *symbol = QgsSymbolLayerUtils::loadSymbol<QgsFillSymbol>( symbolElement, context );
145+
std::unique_ptr< QgsFillSymbol > symbol( QgsSymbolLayerUtils::loadSymbol<QgsFillSymbol>( symbolElement, context ) );
146146
if ( symbol )
147-
layout->pageCollection()->setPageStyleSymbol( symbol );
147+
layout->pageCollection()->setPageStyleSymbol( symbol.get() );
148148
}
149149

150150
QString name = composerElement.attribute( QStringLiteral( "name" ) );

0 commit comments

Comments
 (0)