Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Level 9

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
Kinetics Screensavers
0 Kudos
4 REPLIES 4\
RokuMarkn
Level 8

Re: invalidate bitmap

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
0 Kudos
squirreltown
Level 9

Re: invalidate bitmap

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.
Kinetics Screensavers
0 Kudos
RokuJoel
Roku Employee
Roku Employee

Re: invalidate bitmap

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
0 Kudos
squirreltown
Level 9

Re: invalidate bitmap

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.
Kinetics Screensavers
0 Kudos