Page 1 of 1

Destroying objects?

Posted: Mon Aug 25, 2014 9:49 pm
by skrubbe
Hello,

I am completely new to LÖVE.
When are LÖVE objects (such as audio "Source") destroyed from memory?
Is it when it is no longer referenced in Lua?

Re: Destroying objects?

Posted: Tue Aug 26, 2014 6:03 am
by micha
Luas garbage collector takes care of the memory. From time to time a garbage collection cycle is triggered, and then all objects that have no reference will be removed from the memory.

For most cases, you don't need to know about this in detail and it is enough to just remove all references. In some cases, however, you can also trigger the garbage collection manually to force it to free memory.