From 9a32c000702a4f98c27361a8516134deec36e6af Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 29 Mar 2024 14:28:54 +0100 Subject: [PATCH] * improve TFPSList.Delete as proposed by Alexey Torgashin, resolves #40718 --- rtl/objpas/fgl.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtl/objpas/fgl.pp b/rtl/objpas/fgl.pp index 40d986176f..9dc1c31a43 100644 --- a/rtl/objpas/fgl.pp +++ b/rtl/objpas/fgl.pp @@ -607,7 +607,7 @@ begin there. Otherwise, we could accidentally have there a copy of some item on the list, and accidentally Deref it too soon. See http://bugs.freepascal.org/view.php?id=20005. } - FillChar(InternalItems[FCount]^, (FCapacity+1-FCount) * FItemSize, #0); + FillChar(InternalItems[FCount]^, FItemSize, #0); end; procedure TFPSList.DeleteRange(IndexFrom, IndexTo : Integer);