Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
Expand Up @@ -1011,7 +1011,7 @@ void QgsCategorizedSymbolRendererV2Widget::cleanUpSymbolSelector( QgsPanelWidget
if ( !dlg )
return;

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

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

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

void QgsGraduatedSymbolRendererV2Widget::updateSymbolsFromWidget()
Expand Down
6 changes: 6 additions & 0 deletions src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
Expand Up @@ -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 );
Expand Down
8 changes: 8 additions & 0 deletions src/gui/symbology-ng/qgssymbolv2selectordialog.h
Expand Up @@ -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:

/**
Expand Down

0 comments on commit aa0ce1c

Please sign in to comment.