Skip to content

Commit 919f558

Browse files
committed
Use unique_ptr
1 parent f6fa022 commit 919f558

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/analysis/vector/qgszonalstatistics.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( const QgsGeometry &p
455455
QgsRectangle featureBBox = poly.boundingBox().intersect( &rasterBBox );
456456
QgsRectangle intersectBBox = rasterBBox.intersect( &featureBBox );
457457

458-
QgsRasterBlock *block = mRasterProvider->block( mRasterBand, intersectBBox, nCellsX, nCellsY );
458+
std::unique_ptr< QgsRasterBlock > block( mRasterProvider->block( mRasterBand, intersectBBox, nCellsX, nCellsY ) );
459459
for ( int i = 0; i < nCellsY; ++i )
460460
{
461461
double currentX = rasterBBox.xMinimum() + cellSizeX / 2.0 + pixelOffsetX * cellSizeX;
@@ -486,7 +486,6 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( const QgsGeometry &p
486486
}
487487
currentY -= cellSizeY;
488488
}
489-
delete block;
490489
}
491490

492491
bool QgsZonalStatistics::validPixel( float value ) const

0 commit comments

Comments
 (0)