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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -58,13 +58,7 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache,


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

mValueMaps.clear();
} }


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


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


case QgsVectorLayer::ValueRelation: case QgsVectorLayer::ValueRelation:
Expand Down

0 comments on commit 142223b

Please sign in to comment.