Destroying objects?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
skrubbe
Prole
Posts: 1
Joined: Mon Aug 25, 2014 9:41 pm

Destroying objects?

Post 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?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Destroying objects?

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests