samspade
Member
Are there cases where sequences and animation curves are automatically destroyed (for example like how non-persistent instances are destroyed on room change)?
In this post Nocturn said the following:
In this post Nocturn said the following:
I believe I understand what he means. For example, if you create an instance and never use it, GM is still tracking it so until you destroy it it is sitting there and using memory. However, for instances at least, unless they are marked persistent, they are destroyed when the room ends (and presumably then garbage collected). Is the same thing true for sequences and animation curves? I read through the manual for both sequences and animation curves (did a google search and watched tutorials as well) and probably just missed it but I couldn't see any circumstances where they are auto destroyed like with non-persistent instances on room end. Are there such cases?Now, for instances, anim curves and sequences, you should still ALWAYS use the appropriate destroy functions, as they will NOT be garbage collected automatically. They are "first-class" assets, which means if you define one in code but don't use it, it's STILL taking up memory, much like a global struct or function. So when you call the destroy function you are de-referencing it completely for the GC to pick up.