summaryrefslogtreecommitdiff
path: root/packages/fcl-image
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-11-26 19:06:36 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-11-26 19:06:36 +0000
commitd7a42409d0ebe5c522724ba9eb2da52070a50a9f (patch)
tree9ba1e763a0fea77c37fcc4b0d33ef14f7e16f171 /packages/fcl-image
parenteb401aff06caa0a32a141417baa13596e69f685a (diff)
downloadfpc-d7a42409d0ebe5c522724ba9eb2da52070a50a9f.tar.gz
* Patch from Mattias Gaertner to fix memory leak
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12235 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-image')
-rw-r--r--packages/fcl-image/src/fpinterpolation.inc30
1 files 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 }