E Everest Member Licensed User Longtime User Aug 28, 2012 #1 Hello, I have a list object aList. I have a 'type' object that contains a map object and a string. aSection aList is a list of aSection. If I call aList.clear does it unwind and free all the objects in each aSection? Or do I need to unwind it and call clear on each map object so it can be freed when I call aList.clear? Ciao, Mark
Hello, I have a list object aList. I have a 'type' object that contains a map object and a string. aSection aList is a list of aSection. If I call aList.clear does it unwind and free all the objects in each aSection? Or do I need to unwind it and call clear on each map object so it can be freed when I call aList.clear? Ciao, Mark
Erel B4X founder Staff member Licensed User Longtime User Aug 29, 2012 #2 List.Clear removes all items from the list. The Garbage Collector will free any object that there aren't any references to it. So if the list was the only reference to those items then they will eventually be freed. Upvote 0
List.Clear removes all items from the list. The Garbage Collector will free any object that there aren't any references to it. So if the list was the only reference to those items then they will eventually be freed.
E Everest Member Licensed User Longtime User Aug 29, 2012 #3 Hello, Thanks that was what I thought. Years of being careful about memory allocation/deallocation is a trait I can not discard because I still program in other languages. Mark Upvote 0
Hello, Thanks that was what I thought. Years of being careful about memory allocation/deallocation is a trait I can not discard because I still program in other languages. Mark