Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
squirreltown
Roku Guru

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
Visitor

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
Roku Guru

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
Binge Watcher

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.