Delphi XE, win 7x64. Прекрасно работающий несколько лет назад код, вдруг стал выдавать AV
|
---|
Project xxx.exe raised exception class EAccessViolation with message 'Access violation at address 00409230 in module 'xxx.exe'. Read of address CC8B1287'. |
Сокращенный до воспроизводимого минимума код:
function GetNumForNextInstance: string;
var
il: TList<Integer>;
function EnumProc(h: HWND; Param: LongInt): Boolean; stdcall;
begin
il.Add(1); // AV here!
end;
begin
il := TList<Integer>.Create;
try
il.Add(0); // OK
EnumWindows(@EnumProc, 0);
finally
il.Free;
end;
end;
Что не так?
Скрин с callstack: