mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Use unique_ptr
This commit is contained in:
parent
f6fa022910
commit
919f558877
@ -455,7 +455,7 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( const QgsGeometry &p
|
||||
QgsRectangle featureBBox = poly.boundingBox().intersect( &rasterBBox );
|
||||
QgsRectangle intersectBBox = rasterBBox.intersect( &featureBBox );
|
||||
|
||||
QgsRasterBlock *block = mRasterProvider->block( mRasterBand, intersectBBox, nCellsX, nCellsY );
|
||||
std::unique_ptr< QgsRasterBlock > block( mRasterProvider->block( mRasterBand, intersectBBox, nCellsX, nCellsY ) );
|
||||
for ( int i = 0; i < nCellsY; ++i )
|
||||
{
|
||||
double currentX = rasterBBox.xMinimum() + cellSizeX / 2.0 + pixelOffsetX * cellSizeX;
|
||||
@ -486,7 +486,6 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( const QgsGeometry &p
|
||||
}
|
||||
currentY -= cellSizeY;
|
||||
}
|
||||
delete block;
|
||||
}
|
||||
|
||||
bool QgsZonalStatistics::validPixel( float value ) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user