Skip to content
Permalink
Browse files

Fix leaks in raster calculator

  • Loading branch information
nyalldawson committed Aug 26, 2015
1 parent 2a9e810 commit a417dcf7321993da7706645157a05bc54a1534b3
Showing with 6 additions and 9 deletions.
  1. +6 −9 src/analysis/raster/qgsrastercalculator.cpp
@@ -90,12 +90,12 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
// if crs transform needed
if ( it->raster->crs() != mOutputCrs )
{
QgsRasterProjector* proj = new QgsRasterProjector();
proj->setCRS( it->raster->crs(), mOutputCrs );
proj->setInput( it->raster->dataProvider()->clone() );
proj->setPrecision( QgsRasterProjector::Exact );
QgsRasterProjector proj;
proj.setCRS( it->raster->crs(), mOutputCrs );
proj.setInput( it->raster->dataProvider() );
proj.setPrecision( QgsRasterProjector::Exact );

block = proj->block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows );
block = proj.block( it->bandNumber, mOutputRectangle, mNumOutputColumns, mNumOutputRows );
}
else
{
@@ -155,10 +155,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
qWarning( "RasterIO error!" );
}

if ( resultIsNumber )
{
delete[] calcData;
}
delete[] calcData;
}

}

0 comments on commit a417dcf

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