아래 코드를 실행할 때 EAccessViolation이 발생하는 이유는 무엇입니까? 위의 코드가 된 TForm1에 사용되는TList.Remove()가 EAccessViolation 오류를 생성하는 이유는 무엇입니까?
uses
Generics.Collections;
...
var
list: TList<TNotifyEvent>;
...
begin
list := TList<TNotifyEvent>.Create();
try
list.Add(myNotifyEvent);
list.Remove(myNotifyEvent); // EAccessViolation at address...
finally
FreeAndNil(list);
end;
end;
procedure myNotifyEvent(Sender: TObject);
begin
OutputDebugString('event'); // nebo cokoliv jineho
end;
음,이 질문에 대한 답변이 아닙니다. 질문에 표시된 'myNotifyEvent'가'TNotifyEvent' 시그니처와 일치하지 않기 때문에 현재의 코드는 무효입니다 (이 메서드는 메서드가 아닙니다). –