#Lists don't seem to clear from memory when parent Object is Destroy()ed
1 messages · Page 1 of 1 (latest)
if anyone has any suggestions for how to deal with this pls lemme know
PS: I was asked to post here rather than #💻┃code-beginner so I'm not crossposting lol.
is the list creating new tiles or just referencing ones that already exist
because when you destroy a list, the elements only get destroyed if nothing else is referencing them
it's creating a brand new list and tile items every time.
nothing else should be referencing them, only the individual enemy objects that have them.
if the tiles derive from UnityEngine.Object (like a monobehaviour, gameobject, asset, etc) then they get handled slightly differently and you need to destroy them by hand
because they never get garbage collected
hm. well a Tile is a custom class object
plain c# class?
hm yeah
if youre certain there are no more references to the tile objects after the list is gone, then the memory has got to be from something else
is there some way I could determine what's clogging up the memory, directly?
I just assumed it was that cus it's a relatively large list of information every time an enemy respawns
ah. didn't realize it had something for memory, directly.
probably a bunch of videos for learning how to read it
is it able to be included in a build?