I have a descendant of TObjectList.
It holds descandants af TThread.
constructor TThumbLoaderList.Create(aMax:integer);
begin
inherited Create(false);
OwnsObjects := false;
FMaxActive := aMax;
FActive := 0;
end;
At some point, I need to clear the list.
procedure TThumbLoaderList.Clear;
begin
while Count > 0 do Remove(Items[0]);
// inherited Clear;
FActive := 0;
end;
Originally, I used the Inherited. It gives an error, when removing the last (I think) object:
List Index out of Bounds (x)
Which does not make sense - why does it try to remove an item not there?
So I wrote my own clear - simply removing the first item, until none is left.
It gives the same error:
List Index out of Bounds (x)
- even tho noone asked it to remove the x'th index, only the 0'th.
Any explanations or workaround?