Skip to content
Permalink
Browse files

[GDAL provider] reintroduce use of unique_ptr removed in d00efde

  • Loading branch information
rouault committed Nov 9, 2017
1 parent 4daf689 commit faa0861d97b5c7834180b884a159d224cdac44fa
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/providers/gdal/qgsgdalprovider.cpp
@@ -2732,7 +2732,7 @@ QGISEXTERN QgsGdalProvider *create(
//create dataset
CPLErrorReset();
char **papszOptions = papszFromStringList( createOptions );
GDALDatasetH dataset = GDALCreate( driver, uri.toUtf8().constData(), width, height, nBands, ( GDALDataType )type, papszOptions );
gdal::dataset_unique_ptr dataset( GDALCreate( driver, uri.toUtf8().constData(), width, height, nBands, ( GDALDataType )type, papszOptions ) );
CSLDestroy( papszOptions );
if ( !dataset )
{
@@ -2741,10 +2741,10 @@ QGISEXTERN QgsGdalProvider *create(
return new QgsGdalProvider( uri, error );
}

GDALSetGeoTransform( dataset, geoTransform );
GDALSetProjection( dataset, crs.toWkt().toLocal8Bit().data() );
GDALSetGeoTransform( dataset.get(), geoTransform );
GDALSetProjection( dataset.get(), crs.toWkt().toLocal8Bit().data() );

return new QgsGdalProvider( uri, true, dataset );
return new QgsGdalProvider( uri, true, dataset.release() );
}

bool QgsGdalProvider::write( void *data, int band, int width, int height, int xOffset, int yOffset )

0 comments on commit faa0861

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