From 2912ca6736ad6838dba22e7ebe84df524c4ef8c3 Mon Sep 17 00:00:00 2001 From: Jacky Volpes Date: Tue, 27 Aug 2024 11:05:20 +0200 Subject: [PATCH] fix(qgsfeaturepool): better synchronization between cache and spatial index --- src/analysis/vector/geometry_checker/qgsfeaturepool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/analysis/vector/geometry_checker/qgsfeaturepool.cpp b/src/analysis/vector/geometry_checker/qgsfeaturepool.cpp index 5a53b3a6e5f6..5090b1086408 100644 --- a/src/analysis/vector/geometry_checker/qgsfeaturepool.cpp +++ b/src/analysis/vector/geometry_checker/qgsfeaturepool.cpp @@ -66,6 +66,9 @@ bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature ) } locker.changeMode( QgsReadWriteLocker::Write ); mFeatureCache.insert( id, new QgsFeature( feature ) ); + + //cleanup the index, in case the feature was evicted from the cache but is still in the index + mIndex.deleteFeature( id ); mIndex.addFeature( feature ); } return true;