Generic TList<> in Delphi 2009 crash on IndexOf

后端 未结 2 683
余生分开走
余生分开走 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:31

    This is a bug in the default constructor of TObjectList, and I thought it was fixed in update 3. If you're still seeing it, use a different constructor or just update to D2010 or XE, where it's definitely fixed. (And you'll really want to get off of D2009 if you want to work with generics anyway.)

提交回复
热议问题