Skip to content

Commit

Permalink
QgsVectorLayerSaveAsDialog::createControls(): fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Oct 3, 2023
1 parent ec6e480 commit 4735bd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/ogr/qgsvectorlayersaveasdialog.cpp
Expand Up @@ -236,7 +236,6 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c
for ( it = options.constBegin(); it != options.constEnd(); ++it )
{
QgsVectorFileWriter::Option *option = it.value();
QLabel *label = new QLabel( it.key() );
QWidget *control = nullptr;
switch ( option->type )
{
Expand Down Expand Up @@ -295,6 +294,8 @@ QList<QPair<QLabel *, QWidget *> > QgsVectorLayerSaveAsDialog::createControls( c

if ( control )
{
QLabel *label = new QLabel( it.key() );

// Pack the tooltip in some html element, so it gets linebreaks.
label->setToolTip( QStringLiteral( "<p>%1</p>" ).arg( option->docString.toHtmlEscaped() ) );
control->setToolTip( QStringLiteral( "<p>%1</p>" ).arg( option->docString.toHtmlEscaped() ) );
Expand Down

0 comments on commit 4735bd9

Please sign in to comment.