Forum Discussion
BinaryMadman
13 years agoVisitor
"TheEndless" wrote:
I believe the key is invalidating the bitmap and the region before creating the new one. In your code, you're creating a new bitmap without invalidating the previous one, so the memory from the previous bitmap is still going to be in use when you try creating the new one. You should also invalidate the region before creating the new bitmap, because it will hold the reference to the previous bitmap open, resulting in the same issue.
Add the following lines immediately after your "NewFile:" label and see if it helps:bigbm = invalid
backgroundRegion = invalid
I added those two lines of code and unfortunately it still has the same problems. Debug screen either says the bigbm create failed or or backroundRegion failed.
You probably need to do some kind of garbage collection and/or destroy your roScreen and create a new one.
What kind of statements do i need to use to do some garbage collection, just set the object to invalid? I tried something called RunGarbageCollector() but that didn't help. I'm sure there has got to be a way to do this, roSlideshow is able to go through 25+ image pages without memory error. It would have been even better if roSlideShow supported scrolling, i wouldn't need to create my own. 😄