Skip to content

Commit 142223b

Browse files
committedMay 13, 2013
[Fix #7698] Attributetable crashes on close when valuemap is used
1 parent 110b87e commit 142223b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed
 

‎src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayerCache *layerCache,
5858

5959
QgsAttributeTableModel::~QgsAttributeTableModel()
6060
{
61-
const QMap<QString, QVariant> *item;
62-
foreach ( item, mValueMaps )
63-
{
64-
delete item;
65-
}
66-
67-
mValueMaps.clear();
61+
qDeleteAll( mValueMaps );
6862
}
6963

7064
bool QgsAttributeTableModel::loadFeatureAtId( QgsFeatureId fid ) const
@@ -201,7 +195,7 @@ void QgsAttributeTableModel::loadAttributes()
201195
continue;
202196

203197
case QgsVectorLayer::ValueMap:
204-
mValueMaps.insert( idx, &layer()->valueMap( idx ) );
198+
mValueMaps.insert( idx, new QMap< QString, QVariant >( layer()->valueMap( idx ) ) );
205199
break;
206200

207201
case QgsVectorLayer::ValueRelation:

0 commit comments

Comments
 (0)
Please sign in to comment.