Skip to content

Commit

Permalink
Fix QgsReadWriteLocker changeMode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elpaso committed Dec 13, 2018
1 parent 7fd6a20 commit 14e59ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsreadwritelocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ void QgsReadWriteLocker::changeMode( QgsReadWriteLocker::Mode mode )

unlock();

mMode = mode;

if ( mMode == Read )
mLock.lockForRead();
else if ( mMode == Write )
Expand Down

0 comments on commit 14e59ee

Please sign in to comment.