Skip to content

Commit

Permalink
Replace calls to the now-deprecated-in-GDAL-trunk OGRFree() by CPLFree()
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 25, 2016
1 parent a1eeed4 commit 3024fe7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/core/qgscoordinatereferencesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool QgsCoordinateReferenceSystem::createFromUserInput( const QString &theDefini
if ( OSRExportToWkt( crs, &wkt ) == OGRERR_NONE )
{
theWkt = wkt;
OGRFree( wkt );
CPLFree( wkt );
}
OSRDestroySpatialReference( crs );
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1823,7 +1823,7 @@ bool QgsCoordinateReferenceSystem::loadIds( QHash<int, QString> &wkts )
wkts.insert( epsg, wkt );
n++;

OGRFree( wkt );
CPLFree( wkt );
}

f.close();
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsimagewarper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassnewmapset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 3024fe7

Please sign in to comment.