How do i return an object from a function in Delphi without causing Access Violation?

后端 未结 10 1238
被撕碎了的回忆
被撕碎了的回忆 2021-02-13 14:54

I have a delphi function that returns a TStringList, but when I return a value and try to use it I get a Access Violation Error i.e

myStringList := FuncStringLis         


        
10条回答
  •  孤城傲影
    2021-02-13 15:25

    Another possibility is to use a dynamic array instead of a TStringList. Since arrays are reference counted, you will never have to worry about freeing it.

提交回复
热议问题