Release memory in the Main.lua

Hi,

I have a game with multiple scenes. All are OK when handleling specific scene related to realsing all resourses.

My question how can I free the resourses that exist in the Main.Lua.

In each specific scene I handle the free of resourse in the scene:destroy( event ) - No problem but where is the place that I can do the same in the Main.Lua (there is no such function of destroy) 

Thanks ,

 Yuval

What resources do you have in main.lua?

–SonicX278

What are you needing to destroy?

Are you sure you need to?

Rob

In the main.lua I have defined general varaibles that is been used by all seneses.

E.g. Tables, Audios and Images.

I think that when the application is been terminated all these variables should be free from memory. Is it so ? or I don’t need to take care for this activity.

Yuval

When your app exits, your memory dumps. If you load something in main.lua and you’re using composer, the assumption is you’re going to want that around for the run of the app. If you’re done with it you can dispose it.

Rob

What resources do you have in main.lua?

–SonicX278

What are you needing to destroy?

Are you sure you need to?

Rob

In the main.lua I have defined general varaibles that is been used by all seneses.

E.g. Tables, Audios and Images.

I think that when the application is been terminated all these variables should be free from memory. Is it so ? or I don’t need to take care for this activity.

Yuval

When your app exits, your memory dumps. If you load something in main.lua and you’re using composer, the assumption is you’re going to want that around for the run of the app. If you’re done with it you can dispose it.

Rob