Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4735bd9

Browse files
rouaultnyalldawson
authored andcommittedOct 3, 2023
QgsVectorLayerSaveAsDialog::createControls(): fix memory leak
1 parent ec6e480 commit 4735bd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/gui/ogr/qgsvectorlayersaveasdialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c
236236
for ( it = options.constBegin(); it != options.constEnd(); ++it )
237237
{
238238
QgsVectorFileWriter::Option *option = it.value();
239-
QLabel *label = new QLabel( it.key() );
240239
QWidget *control = nullptr;
241240
switch ( option->type )
242241
{
@@ -295,6 +294,8 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c
295294

296295
if ( control )
297296
{
297+
QLabel *label = new QLabel( it.key() );
298+
298299
// Pack the tooltip in some html element, so it gets linebreaks.
299300
label->setToolTip( QStringLiteral( "<p>%1</p>" ).arg( option->docString.toHtmlEscaped() ) );
300301
control->setToolTip( QStringLiteral( "<p>%1</p>" ).arg( option->docString.toHtmlEscaped() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.