Skip to content

Commit aad7c5e

Browse files
committed
Fix leak in QgsCoordinateReferenceSystem
1 parent 2555d28 commit aad7c5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/qgscoordinatereferencesystem_p.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData
6565
, mSRID( other.mSRID )
6666
, mAuthId( other.mAuthId )
6767
, mIsValid( other.mIsValid )
68-
, mCRS( OSRNewSpatialReference( nullptr ) )
68+
, mCRS( nullptr )
6969
, mValidationHint( other.mValidationHint )
7070
, mWkt( other.mWkt )
7171
, mProj4( other.mProj4 )
@@ -76,6 +76,10 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData
7676
{
7777
mCRS = OSRClone( other.mCRS );
7878
}
79+
else
80+
{
81+
mCRS = OSRNewSpatialReference( nullptr );
82+
}
7983
}
8084

8185
~QgsCoordinateReferenceSystemPrivate()

0 commit comments

Comments
 (0)