how do I free stuff?

BlitzMax Forums/BlitzMax Programming/how do I free stuff?

eraseing all refrences to the image and flushmem does not free it.
That's because you aren't using references.
you have to use the Release command
Well that, or you have to use objects.
Print MemAlloced()+"    beginning"
Graphics 800,600
Print MemAlloced()+"    after graphics"
Local i:TImage=CreateImage(400,400)
Print MemAlloced()+"    after createimage"
i=Null
'Release i
Print MemAlloced()+"    after release image"
flushmem
Print MemAlloced()+"    after flushmem"
EndGraphics
Print MemAlloced()+"    after endgraphics"
end
Read this thread for more information on how the "Garbage Collector" works.