소스 검색

* improve TFPSList.Delete as proposed by Alexey Torgashin, resolves #40718

florian 1 년 전
부모
커밋
9a32c00070
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      rtl/objpas/fgl.pp

+ 1 - 1
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);