Skip to content
Permalink
Browse files
Fix double delete of symbol
Fix #15961
  • Loading branch information
m-kuhn committed May 12, 2017
1 parent 396a135 commit aa0ce1c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
@@ -1011,7 +1011,7 @@ void QgsCategorizedSymbolRendererV2Widget::cleanUpSymbolSelector( QgsPanelWidget
if ( !dlg )
return;

delete dlg->symbol();
dlg->releaseSymbol();
}

void QgsCategorizedSymbolRendererV2Widget::updateSymbolsFromWidget()
@@ -693,7 +693,7 @@ void QgsGraduatedSymbolRendererV2Widget::cleanUpSymbolSelector( QgsPanelWidget *
if ( !dlg )
return;

delete dlg->symbol();
dlg->releaseSymbol();
}

void QgsGraduatedSymbolRendererV2Widget::updateSymbolsFromWidget()
@@ -300,6 +300,12 @@ void QgsSymbolV2SelectorWidget::setMapCanvas( QgsMapCanvas *canvas )
listWidget->setMapCanvas( canvas );
}

void QgsSymbolV2SelectorWidget::releaseSymbol()
{
delete mSymbol;
mSymbol = nullptr;
}

void QgsSymbolV2SelectorWidget::loadSymbol( QgsSymbolV2* symbol, SymbolLayerItem* parent )
{
SymbolLayerItem* symbolItem = new SymbolLayerItem( symbol );
@@ -128,6 +128,14 @@ class GUI_EXPORT QgsSymbolV2SelectorWidget: public QgsPanelWidget, private Ui::Q
*/
QgsSymbolV2* symbol() { return mSymbol; }

/**
* Delete the symbol.
*
* \note Not available in Python
* \note Added in QGIS 2.18.8
*/
void releaseSymbol();

protected:

/**

0 comments on commit aa0ce1c

Please sign in to comment.