Skip to content

Commit

Permalink
Fix leaks in raster calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 26, 2015
1 parent 2a9e810 commit a417dcf
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/analysis/raster/qgsrastercalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -155,10 +155,7 @@ int QgsRasterCalculator::processCalculation( QProgressDialog* p )
qWarning( "RasterIO error!" );
}

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

}
Expand Down

0 comments on commit a417dcf

Please sign in to comment.