Are the NobleScenes destroyed after transitioninig to other NobleScenes? If not, is there a way to destroy the unused instance? #88
Unanswered
optimusdag
asked this question in
Support Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm creating a game that reuses the same NobleScene a lot of times with different parameters that makes it load a different map each time. The problem is that I have a lot of memory used in sound effects and it seems each time I transition back to this scene the init method is called again and it tries to load all of the sound effects, generating malloc errors and finally crashing the game.
So my question is: Is there a way to ensure the whole NobleScene instance is destroyed (and garbage collected) once the transition is over? So when I come back to the same NobleScene, everything can start from scratch.
Thanks in advance for your help.
UPDATE: In the meantime, to be able to continue development, I implemented an audio manager singleton that caches the references of each sound effect and does not allow the same effect to be loaded more than one time during the execution of the game. Anyways, it would be good to have an answer to this question in case me or someone else runs into a similar issue with resources instantiated by a scene than need to be managed.
Beta Was this translation helpful? Give feedback.
All reactions