Skip to content

Commit

Permalink
[Fix #7698] Attributetable crashes on close when valuemap is used
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 13, 2013
1 parent 110b87e commit 142223b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -58,13 +58,7 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache,

QgsAttributeTableModel::~QgsAttributeTableModel()
{
const QMap<QString, QVariant> *item;
foreach ( item, mValueMaps )
{
delete item;
}

mValueMaps.clear();
qDeleteAll( mValueMaps );
}

bool QgsAttributeTableModel::loadFeatureAtId( QgsFeatureId fid ) const
Expand Down Expand Up @@ -201,7 +195,7 @@ void QgsAttributeTableModel::loadAttributes()
continue;

case QgsVectorLayer::ValueMap:
mValueMaps.insert( idx, &layer()->valueMap( idx ) );
mValueMaps.insert( idx, new QMap< QString, QVariant >( layer()->valueMap( idx ) ) );
break;

case QgsVectorLayer::ValueRelation:
Expand Down

0 comments on commit 142223b

Please sign in to comment.