File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/analysis/vector/geometry_checker Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,15 @@ QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer )
38
38
39
39
bool QgsFeaturePool::getFeature ( QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback )
40
40
{
41
- QgsReadWriteLocker locker ( mCacheLock , QgsReadWriteLocker::Read );
41
+ // Why is there a write lock acquired here? Weird, we only want to read a feature from the cache, right?
42
+ // A method like `QCache::object(const Key &key) const` certainly would not modify its internals.
43
+ // Mmmh. What if reality was different?
44
+ // If one reads the docs very, very carefully one will find the term "reentrant" in the
45
+ // small print of the QCache docs. This is the hint that reality is different.
46
+ //
47
+ // https://bugreports.qt.io/browse/QTBUG-19794
48
+
49
+ QgsReadWriteLocker locker ( mCacheLock , QgsReadWriteLocker::Write );
42
50
QgsFeature *cachedFeature = mFeatureCache .object ( id );
43
51
if ( cachedFeature )
44
52
{
You can’t perform that action at this time.
0 commit comments