Skip to content
Permalink
Browse files

Replace calls to the now-deprecated-in-GDAL-trunk OGRFree() by CPLFree()

  • Loading branch information
rouault committed Nov 25, 2016
1 parent a1eeed4 commit 3024fe701d2c4defa9bbc066cd38cb3a1918cc7a
@@ -226,7 +226,7 @@ bool QgsCoordinateReferenceSystem::createFromUserInput( const QString &theDefini
if ( OSRExportToWkt( crs, &wkt ) == OGRERR_NONE )
{
theWkt = wkt;
OGRFree( wkt );
CPLFree( wkt );
}
OSRDestroySpatialReference( crs );
}
@@ -1280,7 +1280,7 @@ QString QgsCoordinateReferenceSystem::toWkt() const
if ( OSRExportToWkt( d->mCRS, &wkt ) == OGRERR_NONE )
{
d->mWkt = wkt;
OGRFree( wkt );
CPLFree( wkt );
}
}
return d->mWkt;
@@ -1823,7 +1823,7 @@ bool QgsCoordinateReferenceSystem::loadIds( QHash<int, QString> &wkts )
wkts.insert( epsg, wkt );
n++;

OGRFree( wkt );
CPLFree( wkt );
}

f.close();
@@ -108,10 +108,10 @@ bool QgsImageWarper::createDestinationDataset( const QString &outputName, GDALDa
OGRErr err = oTargetSRS.exportToWkt( &wkt );
if ( err != CE_None || GDALSetProjection( hDstDS, wkt ) != CE_None )
{
OGRFree( wkt );
CPLFree( wkt );
return false;
}
OGRFree( wkt );
CPLFree( wkt );
}

for ( int i = 0; i < GDALGetRasterCount( hSrcDS ); ++i )
@@ -446,7 +446,7 @@ void QgsGrassNewMapset::setGrassProjection()
QgsDebugMsg( QString( "ret = %1" ).arg( ret ) );
QgsDebugMsg( QString( "mProjInfo = %1" ).arg( QString::number(( qulonglong )mProjInfo, 16 ).toLocal8Bit().constData() ) );

OGRFree( wkt );
CPLFree( wkt );
}

if ( !mProjInfo || !mProjUnits )
@@ -206,12 +206,12 @@ bool QgsGdalProvider::crsFromWkt( const char *wkt )
char *pszProj4;
OSRExportToProj4( hCRS, &pszProj4 );
QgsDebugMsg( pszProj4 );
OGRFree( pszProj4 );
CPLFree( pszProj4 );

char *pszWkt = nullptr;
OSRExportToWkt( hCRS, &pszWkt );
QString myWktString = QString( pszWkt );
OGRFree( pszWkt );
CPLFree( pszWkt );

// create CRS from Wkt
mCrs = QgsCoordinateReferenceSystem::fromWkt( myWktString );
@@ -2860,13 +2860,13 @@ QgsCoordinateReferenceSystem QgsOgrProvider::crs() const
char *pszProj4;
OSRExportToProj4( mySpatialRefSys, &pszProj4 );
QgsDebugMsg( pszProj4 );
OGRFree( pszProj4 );
CPLFree( pszProj4 );

char *pszWkt = nullptr;
OSRExportToWkt( mySpatialRefSys, &pszWkt );

srs = QgsCoordinateReferenceSystem::fromWkt( pszWkt );
OGRFree( pszWkt );
CPLFree( pszWkt );
}
else
{

0 comments on commit 3024fe7

Please sign in to comment.
You can’t perform that action at this time.