pranadevil Posted June 20, 2016 Share Posted June 20, 2016 hi everyone, im wondering if when i end a level i should call a method to destroy and collect garbage variables to free memory and resources in a game. do you often do that? and how do you do it? thanks Link to comment Share on other sites More sharing options...
drhayes Posted June 20, 2016 Share Posted June 20, 2016 Just stop referencing them in your code and the GC will pick them up for you eventually. A Phaser.State does have a "shutdown" method. That's a good place to stop listening to signals and stuff. There's no way in JS to tell the GC to run, however. VitaZheltyakov and pranadevil 2 Link to comment Share on other sites More sharing options...
Recommended Posts