Skip to content

Commit 0234cd2

Browse files
committed
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)
1 parent b0638d9 commit 0234cd2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/providers/memory/qgsmemoryprovider.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ bool QgsMemoryProvider::addFeatures( QgsFeatureList & flist )
334334
mFeatures[mNextFeatureId] = *it;
335335
QgsFeature& newfeat = mFeatures[mNextFeatureId];
336336
newfeat.setFeatureId( mNextFeatureId );
337+
newfeat.setValid( true );
337338
it->setFeatureId( mNextFeatureId );
338339

339340
// update spatial index

0 commit comments

Comments
 (0)