In Delphi 2009 do I need to free variant arrays?

后端 未结 1 934
你的背包
你的背包 2021-01-12 18:02

If I have a variant array which holds nothing but simple types, and possible further variant arrays of simple types, do I need to do anything explicit to free memory, or is

相关标签:
1条回答
  • 2021-01-12 19:03

    Variants are managed types. They're owned by the compiler's reference-counting system and don't need to be freed manually.

    If you do something convoluted like typecasting an object to an integer and storing that in the variant, and then making that the only reference to your object, then you'll want to clean that up before the variant goes out of scope, but the variant itself (including variant arrays) is safe.

    0 讨论(0)
提交回复
热议问题