Getting rid of a drawing surface after release()?

Started by geork, Mon 03/05/2010 19:56:40

Previous topic - Next topic

geork

 Hey All!
  Just wondering whether it is possible to alter/get rid of a DrawingSurface variable after it has been released, otherwise I will have a load of GUI's to make...
  Thanks

Calin Leafshade

I dont see why you would want to...

you can always reassign the pointer or just use another one.

geork

 Whoops, my bad, I forgot to do something while reassigning. My apologies

monkey0506

As far as the memory management goes, AGS's garbage collection will completely destroy the surface after doing:

Code: ags
surface = null;


Or if the pointer is assigned to point to a new DrawingSurface instead.

The same holds true for all dynamically created pointer types such as DynamicSprite and Overlay as well. Note if you're ever working with File that you should always call File.Close to ensure you don't do anything that might corrupt/overwrite your data.

SMF spam blocked by CleanTalk