diff options
author | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-05-23 07:11:33 +0000 |
---|---|---|
committer | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-05-23 07:11:33 +0000 |
commit | f409cbf6cb1bb857c95ae0ad38775981e1aff4a0 (patch) | |
tree | 73b808f57f86bec0a4898f02bbf63d220004245b | |
parent | e4040630c6befc604eebc4effd6cc81df962982d (diff) | |
download | fpc-f409cbf6cb1bb857c95ae0ad38775981e1aff4a0.tar.gz |
Patch from Joao Morais to fix memory leak with owner lists
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@11045 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 2ce29a48a7..acc441de90 100644 --- a/rtl/objpas/classes/lists.inc +++ b/rtl/objpas/classes/lists.inc @@ -544,7 +544,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; |