Skip to content

Commit

Permalink
Fix crash in label property dialog (refs #13543)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 8, 2015
1 parent 88976c2 commit d709496
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/app/qgslabelpropertydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ QgsLabelPropertyDialog::~QgsLabelPropertyDialog()
{
QSettings settings;
settings.setValue( QString( "/Windows/ChangeLabelProps/geometry" ), saveGeometry() );

qDeleteAll( mDataDefinedProperties );
}

void QgsLabelPropertyDialog::on_buttonBox_clicked( QAbstractButton *button )
Expand Down Expand Up @@ -143,7 +145,11 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const

disableGuiElements();

mDataDefinedProperties = layerSettings.dataDefinedProperties;
QMap< QgsPalLayerSettings::DataDefinedProperties, QgsDataDefined* >::const_iterator it = layerSettings.dataDefinedProperties.constBegin();
for ( ; it != layerSettings.dataDefinedProperties.constEnd(); ++it )
{
mDataDefinedProperties.insert( it.key(), it.value() ? new QgsDataDefined( *it.value() ) : 0 );
}

//set widget values from data defined results
setDataDefinedValues( layerSettings, vlayer );
Expand Down Expand Up @@ -656,7 +662,7 @@ void QgsLabelPropertyDialog::insertChangedValue( QgsPalLayerSettings::DataDefine
{
QgsDataDefined* dd = ddIt.value();

if ( dd->isActive() && !dd->useExpression() && !dd->field().isEmpty() )
if ( dd && dd->isActive() && !dd->useExpression() && !dd->field().isEmpty() )
{
mChangedProperties.insert( mCurLabelFeat.fieldNameIndex( dd->field() ), value );
}
Expand Down

0 comments on commit d709496

Please sign in to comment.