Fix QgsReadWriteLocker changeMode

since mMode was never updated, the lock
was never toggled from read to write or
vice-versa.

This was leading to crashes because the
paths that were meant to be serialized
and thread safe were not.

Fixes #20789 and probably many more
random crashes where QgsFeaturePool
was used.
This commit is contained in:
Alessandro Pasotti 2018-12-12 18:45:22 +01:00
parent 6de0160fb5
commit b0d1506b72

View File

@ -34,6 +34,8 @@ void QgsReadWriteLocker::changeMode( QgsReadWriteLocker::Mode mode )
unlock();
mMode = mode;
if ( mMode == Read )
mLock.lockForRead();
else if ( mMode == Write )