Skip to content

Commit

Permalink
[GDAL provider] reintroduce use of unique_ptr removed in d00efde
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Nov 9, 2017
1 parent 4daf689 commit faa0861
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand All @@ -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 )
Expand Down

0 comments on commit faa0861

Please sign in to comment.