* Fix bug ID #32136, object not freed when replaced by another

git-svn-id: trunk@36724 -
This commit is contained in:
michael 2017-07-11 07:37:04 +00:00
parent 0c42b6f44a
commit be39ca0c85

View File

@ -699,9 +699,10 @@ end;
procedure TList<T>.SetItem(AIndex: SizeInt; const AValue: T);
begin
if (AIndex < 0) or (AIndex >= Count) then
raise EArgumentOutOfRangeException.CreateRes(@SArgumentOutOfRange);
raise EArgumentOutOfRangeException.CreateRes(@SArgumentOutOfRange);
Notify(FItems[AIndex], cnRemoved);
FItems[AIndex] := AValue;
Notify(AValue, cnAdded);
end;
function TList<T>.GetEnumerator: TEnumerator;