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