invalidate bitmap

OK what am i missing here, I want to clear the bitmap “bigtype” from memory after i leave that screen. its being persistent.

Sub Homescreen()
'on button press
Secondsub()
End sub

Sub Secondsub()
bigtype = CreateObject("roBitmap", {width: 1100, height: 1620, AlphaEnable: false})
'on button press
bigtype = invalid
ThirdSub()
return
End sub

Sub ThirdSub()
'bigtype still in memory here
'if closescreen back to Homescreen() bigtype is removed from memory

End sub

thanks

How do you know it’s still in memory?
It shouldn’t really matter but if you want to force it you might need to call RunGarbageCollector.

–Mark

r2d2_bitmaps.
It matters because there is only a tiny amount of memory to work with to begin with. (3100)
I will try collecting the garbage.
thanks Mark.

Not sure if this affects the variable itself, but the video memory won’t be released until the next screen.Swapbuffers() or screen.Finish() call.

  • Joel

OK so what I was missing was not calling region=invalid at the same time as bitmap=invalid, now it goes away when its supposed to.