C
Carpe Zythum
Guest
I need some thoughts on memory managment for ds_map in Game Maker.
I've created a map of maps in a global variable global.research.
And then I used my custom scripts to generate all the data for research.
But I have a problem with this, the research tree variable needs to exist for the whole game, and in the obj_research_controller ( persistent object )'s destroy event I've used a custom script to free all the memory I've allocated. ( It's a lot of memory, the DS map holds the whole tree, and in each individual tree I have a list object that holds the children of that research. I needed to do this to simulate a binary tree data structure ).
So, I want all that memory to be free when the user exits the game, but, the destroy event of my obj_research_controller doesn't get called when I press the "X" button of my game, or alt+F4.
When you exit through the menu, the script is called, since I destroyed that object manually when the user exits the game that way.
My question is: Does game maker free my allocated resources via a system when I press the "X" or alt+F4, or should I implement a custom system to take care of that event.
PS: My game is for Android aswell, so I don't want a memory leak to exist.
I've created a map of maps in a global variable global.research.
And then I used my custom scripts to generate all the data for research.
But I have a problem with this, the research tree variable needs to exist for the whole game, and in the obj_research_controller ( persistent object )'s destroy event I've used a custom script to free all the memory I've allocated. ( It's a lot of memory, the DS map holds the whole tree, and in each individual tree I have a list object that holds the children of that research. I needed to do this to simulate a binary tree data structure ).
So, I want all that memory to be free when the user exits the game, but, the destroy event of my obj_research_controller doesn't get called when I press the "X" button of my game, or alt+F4.
When you exit through the menu, the script is called, since I destroyed that object manually when the user exits the game that way.
My question is: Does game maker free my allocated resources via a system when I press the "X" or alt+F4, or should I implement a custom system to take care of that event.
PS: My game is for Android aswell, so I don't want a memory leak to exist.