Skip to content

Commit ce62640

Browse files
committedSep 21, 2015
fix crash deleting a new column which contains changed values (fix #13366),
when a column is deleted just rearrange changed attribute map indexes before calling updateLayerFields on the buffer, otherwise QgsVectorLayerFeatureIterator::updateChangedAttributes will use the changed attribute map with old/wrong indexes
1 parent a17dac0 commit ce62640

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/qgsvectorlayerundocommand.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ void QgsVectorLayerUndoCommandAddAttribute::undo()
323323
int index = layer()->fields().fieldOriginIndex( mFieldIndex );
324324

325325
mBuffer->mAddedAttributes.removeAt( index );
326-
mBuffer->updateLayerFields();
327326
mBuffer->handleAttributeDeleted( mFieldIndex );
327+
mBuffer->updateLayerFields();
328328

329329
emit mBuffer->attributeDeleted( mFieldIndex );
330330
}
@@ -417,7 +417,7 @@ void QgsVectorLayerUndoCommandDeleteAttribute::redo()
417417
mBuffer->mAddedAttributes.removeAt( mOriginIndex ); // removing temporary attribute
418418
}
419419

420-
mBuffer->updateLayerFields();
421420
mBuffer->handleAttributeDeleted( mFieldIndex ); // update changed attributes + new features
421+
mBuffer->updateLayerFields();
422422
emit mBuffer->attributeDeleted( mFieldIndex );
423423
}

0 commit comments

Comments
 (0)
Please sign in to comment.