diff options
author | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-05-23 07:12:35 +0000 |
---|---|---|
committer | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-05-23 07:12:35 +0000 |
commit | 4b3d7c29c941e7847618639d47e7b33446dd5d33 (patch) | |
tree | efefcf419643c3059b1d1ee726f23ead22bdbc4b | |
parent | 656749d80a72e195ff1d9d153c4e340a43a0a08e (diff) | |
download | fpc-4b3d7c29c941e7847618639d47e7b33446dd5d33.tar.gz |
Merged revisions 11045 via svnmerge from
svn+ssh://svn.freepascal.org/FPC/svn/fpc/trunk
........
r11045 | michael | 2008-05-23 09:11:33 +0200 (Fri, 23 May 2008) | 1 line
Patch from Joao Morais to fix memory leak with owner lists
........
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@11046 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | rtl/objpas/classes/lists.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rtl/objpas/classes/lists.inc b/rtl/objpas/classes/lists.inc index 0521d14f51..95a804944f 100644 --- a/rtl/objpas/classes/lists.inc +++ b/rtl/objpas/classes/lists.inc @@ -546,7 +546,11 @@ end; procedure TList.SetCount(NewCount: Integer); begin - FList.SetCount(NewCount); + if NewCount < FList.Count then + while FList.Count > NewCount do + Delete(FList.Count - 1) + else + FList.SetCount(NewCount); end; constructor TList.Create; |