Skip to content
Permalink
Browse files

Always mark features as valid when added to memory provider

For other providers features will automatically be made valid
through the proces of adding to the provider's storage itself
and then later retrieving via iterators. But the memory
provider uses a direct copy of the feature, so if we don't
explicitly mark features as valid the provider may be
returning features incorrectly marked as invalid.

(cherry-picked from f2b70cf)
  • Loading branch information
nyalldawson committed May 25, 2016
1 parent b0638d9 commit 0234cd2988d0b24dec466a3d8d760e65a57f16cf
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/providers/memory/qgsmemoryprovider.cpp
@@ -334,6 +334,7 @@ bool QgsMemoryProvider::addFeatures( QgsFeatureList & flist )
mFeatures[mNextFeatureId] = *it;
QgsFeature& newfeat = mFeatures[mNextFeatureId];
newfeat.setFeatureId( mNextFeatureId );
newfeat.setValid( true );
it->setFeatureId( mNextFeatureId );

// update spatial index

0 comments on commit 0234cd2

Please sign in to comment.
You can’t perform that action at this time.