kupo15
Member
Recently I've been convinced that nested lists are more flexible and better than using grids so I've been transitioning my grids to nested lists. I'm really enjoying transitioning my ds_grids into nested lists, however, I have to triple check that when I delete a ds_list that I'm also deleting any lists nested inside of it as well to avoid a memory leak which is a bit of a pain.
For example:
If I destroy List A, I have to make sure I destroy List B-D, and I also have to remove List A pointer from the Master List. When nesting lists for JSON saving, its easier to not worry about all this because you simply mark each list and map as you go and destroy the wrapper at the end, but for persistent data structures that aren't temporary, this seems a bit more involved
Can we and is it practical to use ds_list_mark_as_list for memory management outside of JSON saving/loading as the help file says otherwise?
I'm thinking there has got to be a way that I can create a script called ds_list_destroy_nested(pointer) where I input the list I want to destroy, and the script loops through the rest of the nested data structure, marking each nested list as a list, in which I can then simply destroy the list I started with. Then I can remove the pointer in the list above it
For example:
If I destroy List A, I have to make sure I destroy List B-D, and I also have to remove List A pointer from the Master List. When nesting lists for JSON saving, its easier to not worry about all this because you simply mark each list and map as you go and destroy the wrapper at the end, but for persistent data structures that aren't temporary, this seems a bit more involved
Can we and is it practical to use ds_list_mark_as_list for memory management outside of JSON saving/loading as the help file says otherwise?
I'm thinking there has got to be a way that I can create a script called ds_list_destroy_nested(pointer) where I input the list I want to destroy, and the script loops through the rest of the nested data structure, marking each nested list as a list, in which I can then simply destroy the list I started with. Then I can remove the pointer in the list above it