Skip to content

Commit 9093bcd

Browse files
committed
Fix memory leak in multiband color renderer
1 parent 6b6742b commit 9093bcd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/raster/qgsmultibandcolorrenderer.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,11 @@ QgsRasterBlock* QgsMultiBandColorRenderer::block( int bandNo, QgsRectangle cons
309309
}
310310
}
311311

312-
for ( int i = 0; i < bandBlocks.size(); i++ )
312+
//delete input blocks
313+
QMap<int, QgsRasterBlock*>::const_iterator bandDelIt = bandBlocks.constBegin();
314+
for ( ; bandDelIt != bandBlocks.constEnd(); ++bandDelIt )
313315
{
314-
delete bandBlocks.value( i );
316+
delete bandDelIt.value();
315317
}
316318

317319
return outputBlock;

0 commit comments

Comments
 (0)