Generic TList<> in Delphi 2009 crash on IndexOf

后端 未结 2 686
余生分开走
余生分开走 2021-01-14 09:09

I\'ve seen many mentions of bugs in Delphi 2009 generics, but never expected something so basic to fail in Update 3, no less. Calling IndexOf on a generic TList or TObjectLi

2条回答
  •  清歌不尽
    2021-01-14 09:27

    Have a look at this question. Why is TList.Remove() producing an EAccessViolation error?

    In particular, try creating your TList like this

    TList.Create(TComparer.Default);
    

提交回复
热议问题