From 22bb6c804bd1e7d63acb31879a5940b7bfcc8397 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 26 Nov 2008 19:06:36 +0000 Subject: [PATCH] * Patch from Mattias Gaertner to fix memory leak git-svn-id: trunk@12235 - --- packages/fcl-image/src/fpinterpolation.inc | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/fcl-image/src/fpinterpolation.inc b/packages/fcl-image/src/fpinterpolation.inc index 0a7ceb1186..84aa4e4bcf 100644 --- a/packages/fcl-image/src/fpinterpolation.inc +++ b/packages/fcl-image/src/fpinterpolation.inc @@ -166,19 +166,23 @@ var maxy : integer; rx,ry : integer; begin tempimage := TFPMemoryImage.Create (w,image.height); - tempimage.UsePalette := false; - xfactor := image.Width / w; - yfactor := image.Height / h; - if xfactor > 1.0 then - xsupport := MaxSupport - else - xsupport := xfactor * MaxSupport; - if yfactor > 1.0 then - ysupport := MaxSupport - else - ysupport := yfactor * MaxSupport; - Horizontal (w); - Vertical (x,y,w,h); + try + tempimage.UsePalette := false; + xfactor := image.Width / w; + yfactor := image.Height / h; + if xfactor > 1.0 then + xsupport := MaxSupport + else + xsupport := xfactor * MaxSupport; + if yfactor > 1.0 then + ysupport := MaxSupport + else + ysupport := yfactor * MaxSupport; + Horizontal (w); + Vertical (x,y,w,h); + finally + tempimage.Free; + end; end; { TMitchelInterpolation }