FreeStructure and arrays?

Just starting out? Need help? Post your questions and find answers here.
Smetad_Anarkist
New User
New User
Posts: 8
Joined: Wed Jul 19, 2017 5:50 am

FreeStructure and arrays?

Post by Smetad_Anarkist »

I have a structure that has a field that is an array. When I call FreeStructure to remove it from memory, does the array get freed and deleted nicely or do I have to call FreeArray first?
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: FreeStructure and arrays?

Post by kenmo »

FreeStructure() is "smart" and will free Arrays, Lists, Maps, assuming you allocated it with AllocateStructure().

FreeMemory() is naive and does NOT free these member objects.
(Just like AllocateMemory() does not initialize them.)
Post Reply