Skip to content

Commit

Permalink
Use unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 8, 2018
1 parent f6fa022 commit 919f558
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/analysis/vector/qgszonalstatistics.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -486,7 +486,6 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( const QgsGeometry &p
}
currentY -= cellSizeY;
}
delete block;
}

bool QgsZonalStatistics::validPixel( float value ) const
Expand Down

0 comments on commit 919f558

Please sign in to comment.