Page 1 of 1

FreeStructure and arrays?

Posted: Wed Sep 19, 2018 6:50 pm
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?

Re: FreeStructure and arrays?

Posted: Wed Sep 19, 2018 6:59 pm
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.)