Ok, so I understand your issue better now..
It would appear there is a little bug in there ..
The SetCount currently when reducing the size will call Delete which in turn does call the notify(…)
However, when setcount increases the size it does not call anything to trigger a notify
This only happens when directly setting the setcount instead of simply adding items to it which does propagate a Notify.
procedure TList.SetCount(NewCount: Integer);
begin
if NewCount < FList.Count then
while FList.Count > NewCount do
Delete(FList.Count - 1) // Delete is part of TLIST which does use Notify.
else
FList.SetCount(NewCount); // This calls the FPLIST which does not have Observers etc.
end;
As you can see the Notify method does not get called here NewCount is > FLIST.COunt..
Etc
I suppose you could report this and maybe hope it gets fixed
or you could fix this yourself which would require you to recompile the compiler files..
Thinking of how we can fake this for now... I'll get back to you on that one