Skip to content
Permalink
Browse files

Fix leak when adding symbols

  • Loading branch information
nyalldawson committed Jul 29, 2020
1 parent f48a79c commit 6d0069484de96024b2c547721ccca5105504fa28
Showing with 6 additions and 4 deletions.
  1. +3 −2 src/gui/symbology/qgsstylemanagerdialog.cpp
  2. +3 −2 src/gui/symbology/qgssymbolslistwidget.cpp
@@ -673,9 +673,10 @@ void QgsStyleManagerDialog::pasteItem()
}

QStringList symbolTags = saveDlg.tags().split( ',' );
mStyle->addSymbol( saveDlg.name(), tempSymbol->clone() );
QgsSymbol *newSymbol = tempSymbol.get();
mStyle->addSymbol( saveDlg.name(), tempSymbol.release() );
// make sure the symbol is stored
mStyle->saveSymbol( saveDlg.name(), tempSymbol->clone(), saveDlg.isFavorite(), symbolTags );
mStyle->saveSymbol( saveDlg.name(), newSymbol, saveDlg.isFavorite(), symbolTags );
return;
}

@@ -218,10 +218,11 @@ void QgsSymbolsListWidget::saveSymbol()
QStringList symbolTags = saveDlg.tags().split( ',' );

// add new symbol to style and re-populate the list
mStyle->addSymbol( saveDlg.name(), mSymbol->clone() );
QgsSymbol *newSymbol = mSymbol->clone();
mStyle->addSymbol( saveDlg.name(), newSymbol );

// make sure the symbol is stored
mStyle->saveSymbol( saveDlg.name(), mSymbol->clone(), saveDlg.isFavorite(), symbolTags );
mStyle->saveSymbol( saveDlg.name(), newSymbol, saveDlg.isFavorite(), symbolTags );
}

void QgsSymbolsListWidget::clipFeaturesToggled( bool checked )

0 comments on commit 6d00694

Please sign in to comment.
You can’t perform that action at this time.