Skip to content
Permalink
Browse files

Use unique_ptr

  • Loading branch information
nyalldawson committed Jun 8, 2018
1 parent f6fa022 commit 919f5588775e0c5c8118ba3ba93852ac9f6cbc8f
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/analysis/vector/qgszonalstatistics.cpp
@@ -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

0 comments on commit 919f558

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