Skip to content

Commit

Permalink
Not using reference for QgsFeatureIds since the given value could may…
Browse files Browse the repository at this point in the history
…be be changed on recursive delete.

Recursions are usualy not used with compositions, but to be save, this change has been made.
  • Loading branch information
signedav committed May 7, 2020
1 parent 73b1b2d commit aa82247
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectorlayer.sip.in
Expand Up @@ -1971,7 +1971,7 @@ Deletes a feature from the layer (but does not commit it).
changes can be discarded by calling rollBack().
%End

bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = 0 );
bool deleteFeatures( const QgsFeatureIds fids, DeleteContext *context = 0 );
%Docstring
Deletes a set of features from the layer (but does not commit it)

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -3240,7 +3240,7 @@ bool QgsVectorLayer::deleteFeature( QgsFeatureId fid, QgsVectorLayer::DeleteCont
return res;
}

bool QgsVectorLayer::deleteFeatures( const QgsFeatureIds &fids, QgsVectorLayer::DeleteContext *context )
bool QgsVectorLayer::deleteFeatures( const QgsFeatureIds fids, QgsVectorLayer::DeleteContext *context )
{
bool res = true;
const auto constFids = fids;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -1854,7 +1854,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* to the underlying data provider until a commitChanges() call is made. Any uncommitted
* changes can be discarded by calling rollBack().
*/
bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = nullptr );
bool deleteFeatures( const QgsFeatureIds fids, DeleteContext *context = nullptr );

/**
* Attempts to commit to the underlying data provider any buffered changes made since the
Expand Down

0 comments on commit aa82247

Please sign in to comment.