• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Destroy ds_grid / map / list, even if they are local?

mX273

Member
Hi There

Just short question. It's not that clear in the GM Help.

If i have a local ds_grid like this:
var grid = ds_grid_create(...)

Do I have to destroy it after use as well?

Thanks a lot!

kind regards

mX273
 

TsukaYuriko

☄️
Forum Staff
Moderator
Yes. The only difference to a data structure assigned to an instance-scope variable is that the variable you're storing its reference in is local. The data structure itself is still global and not reference counted. Therefore, it needs to be destroyed - in any case.
 

mX273

Member
By the way. How is this with local created arrays like
var array = [[0, ""]]

Do i have to set it back after use like:
array = 0

?
 
Top