I am not sure why I lost you.
Thanks for clarification, I now understand your arguments.
I tried to remove the FData[0] in the AllocData method; the effect is that the IDE hangs when restarting after building. The TCustomImageListResolution makes use of both byte-wise (System.Move(...) ) and element-wise memory (FData[0]) access to the FData array. Something else must be wrong, too.
The AllocData method has 2 bugs:
1.) SetLength(FData, ACount * FWidth * FHeight * SizeOf(FData[0]));
2.) Inc(FAllocCount, ACount);
It should read:
1.) SetLength(FData, ACount * FWidth * FHeight);
2.) FAllocCount := ACount;
If you fix both, your IDE should work fine. The bugs have been in the LCL for years (I checked 1.4.4 and they are there) - strange that nobody noticed them, including myself when I rewrote the imagelist in 1.9.
Btw. I wanted to send a patch to Mantis but you closed
https://bugs.freepascal.org/view.php?id=34708 as "no change required" :/
procedure TCustomImageListResolution.AllocData(ACount: Integer);
var
n: Integer;
begin
if FAllocCount >= ACount
then Exit;
// calculate number of blocks, add an extra block for the remainder.
n := ACount mod FImageList.FAllocBy;
if n <> 0
then Inc(ACount, FImageList.FAllocBy - n);
SetLength(FData, ACount * FWidth * FHeight);
FAllocCount := ACount;
end;