Skip to content
Browse files

Merge pull request #9335 from qgis/backport-9328-on-release-3_4

Backport #9328 on release-3_4
  • Loading branch information
m-kuhn committed Mar 4, 2019
2 parents ecef55e + 44d7644 commit ad149db71289d7d4e1337b3e1887e03deb49a7df
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/analysis/vector/geometry_checker/qgsfeaturepool.cpp
@@ -38,7 +38,15 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer )

bool QgsFeaturePool::getFeature( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback )
QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Read );
// Why is there a write lock acquired here? Weird, we only want to read a feature from the cache, right?
// A method like `QCache::object(const Key &key) const` certainly would not modify its internals.
// Mmmh. What if reality was different?
// If one reads the docs very, very carefully one will find the term "reentrant" in the
// small print of the QCache docs. This is the hint that reality is different.

QgsReadWriteLocker locker( mCacheLock, QgsReadWriteLocker::Write );
QgsFeature *cachedFeature = mFeatureCache.object( id );
if ( cachedFeature )

0 comments on commit ad149db

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