• 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!

Legacy GM [SOLVED] ds data structure volatility

Hi there, two questions on ds data structure volatility;

If the window focus changes can the data in the ds data structures be lost? Is there anything else that can cause the data loss?

In the event the data is lost, the variable that originally held the data still exists within an instance.
Is it necessary to destroy/clear the list associated with that variable before creating a new list and attaching it to that same variable? (i.e. will there be memory leaks)

I want to hold onto the data indefinitely until I am good and ready to destroy the data structure, but I am afraid it will get lost before I am done with it.
 

DukeSoft

Member
The data in those structures can not be lost automatically, or by garbage collection. If anything, they cause memory leaks because people forget to clean them up :)

You can alt-tab or even hibernate your computer, and the data will still be there. Arrays on the other hand get cleared automatically if there's no more pointer to them, and surfaces _can_ be lost and _do_ get lost (sometimes on alt+tab, sometimes randomly, sometimes on hibernate).
 

Simon Gust

Member
Hi there, two questions on ds data structure volatility;

If the window focus changes can the data in the ds data structures be lost? Is there anything else that can cause the data loss?

In the event the data is lost, the variable that originally held the data still exists within an instance.
Is it necessary to destroy/clear the list associated with that variable before creating a new list and attaching it to that same variable? (i.e. will there be memory leaks)

I want to hold onto the data indefinitely until I am good and ready to destroy the data structure, but I am afraid it will get lost before I am done with it.
lol, where did you hear that from, sounds like a hoax to me. The only data that can be lost would be surface data as other programs may require the sparce vram.
 

DukeSoft

Member
Oh, one thing to mention: ds_maps in async events (http calls / network calls) can be lost after the event is done.
 
lol, where did you hear that from, sounds like a hoax to me. The only data that can be lost would be surface data as other programs may require the sparce vram.
Yeah, that's what I thought, but I was working on my project just now and alt-tabbed out and stuff just disappeared off-screen, (stuff I had in ds_lists). I tested and it happened twice... I just got a little unsettled... :confused: maybe I should check my surface handling... :rolleyes:
 
Top