Skip to content

Commit

Permalink
Avoid some unnecessary work when destructing QgsCoordinateReferenceSy…
Browse files Browse the repository at this point in the history
…stemPrivate

(cherry picked from commit 97b7ab9)
  • Loading branch information
nyalldawson committed Jan 15, 2021
1 parent 2d339cc commit 9ce4b8b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/qgscoordinatereferencesystem_p.h
Expand Up @@ -95,8 +95,12 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData
~QgsCoordinateReferenceSystemPrivate()
{
#if PROJ_VERSION_MAJOR>=6
QgsReadWriteLocker locker( mProjLock, QgsReadWriteLocker::Write );
cleanPjObjects();
QgsReadWriteLocker locker( mProjLock, QgsReadWriteLocker::Read );
if ( !mProjObjects.empty() || mPj )
{
locker.changeMode( QgsReadWriteLocker::Write );
cleanPjObjects();
}
#else
OSRDestroySpatialReference( mCRS );
#endif
Expand Down

0 comments on commit 9ce4b8b

Please sign in to comment.