Skip to content

Commit

Permalink
Merge pull request #548 from minorua/raster_memory_leaks
Browse files Browse the repository at this point in the history
Fix some memory leaks Fix #6795
  • Loading branch information
NathanW2 committed Apr 22, 2013
2 parents 2073f87 + f3ab812 commit 13d35ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/raster/qgscontrastenhancement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ QgsContrastEnhancement::QgsContrastEnhancement( const QgsContrastEnhancement& ce

QgsContrastEnhancement::~QgsContrastEnhancement()
{
delete [] mLookupTable;
delete mContrastEnhancementFunction;
}
/*
*
Expand Down
2 changes: 2 additions & 0 deletions src/core/raster/qgsrasterinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ QgsRasterBandStats QgsRasterInterface::bandStatistics( int theBandNo,
myMean += myDelta / myRasterBandStats.elementCount;
mySumOfSquares += myDelta * ( myValue - myMean );
}
delete blk;
}
}

Expand Down Expand Up @@ -478,6 +479,7 @@ QgsRasterHistogram QgsRasterInterface::histogram( int theBandNo,
myHistogram.histogramVector[myBinIndex] += 1;
myHistogram.nonNullCount++;
}
delete blk;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasternuller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ QGis::DataType QgsRasterNuller::dataType( int bandNo ) const
QgsRasterBlock * QgsRasterNuller::block( int bandNo, QgsRectangle const & extent, int width, int height )
{
QgsDebugMsg( "Entered" );
QgsRasterBlock *outputBlock = new QgsRasterBlock();
if ( !mInput )
{
QgsRasterBlock *outputBlock = new QgsRasterBlock();
return outputBlock;
}

Expand Down
1 change: 1 addition & 0 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@ QgsRasterIdentifyResult QgsGdalProvider::identify( const QgsPoint & thePoint, Id
{
results.insert( i, value );
}
delete myBlock;
}
return QgsRasterIdentifyResult( QgsRasterDataProvider::IdentifyFormatValue, results );
}
Expand Down

0 comments on commit 13d35ac

Please sign in to comment.