2020-11-12 08:39 AM
Hi,
I came across the missing implementation of CacheableContainer::cachedBitmapId in the following situation:
First I thought the problem is caused somewhere in my code. But I could not find any bug in my code. Then I reviewed the CacheableContainer sources and bingo:
When a screen is placed in a portion of memory that was used to house another screen, the private member CacheableContainer::cachedBitmapId might not be initialized as expected.
This bug is solved by calling setCacheBitmap(BITMAP_INVALID) in the constructor of the first screen. (The source of CacheableContainer.hpp and .cpp led me to this fix.)
=> Could you please add a constructor to CacheableContainer and initialize all members which are introduced in CacheableContainer to default values that let the CacheableContainer work correctly?
Thanks & kind regards,
Klemens Pleiner
2020-11-18 12:46 AM
Hi Klemens!
Thanks for investigating, i'll look into it. Do you have a small project that shows the issue i can look at?
/Martin
2020-11-18 05:53 AM
Hi Klemens,
Could you also add this input to the "idea zone" section of this forum ? This will help us track it and forward it internally.
/Romain
2020-11-18 09:15 PM
Hi Martin,
I'm sorry, I've no small project that demonstrates the problem. If you really need one, I'd have to create on that does the following:
Just tell me, if you really need such an example.
KR, Klemens
2020-11-18 09:18 PM
2020-11-19 12:37 AM
Please do! Thanks :)
2020-11-19 01:37 AM
Martin, here you are:
The SupportDemo contains two screens. A button on each screen switches to the other screen.
If you compile it like it is contained in the zip archive, you will not see the button on Screen1 anymore when you return from Screen2.
If you comment the lines 24-28 in Screen2View.hpp, the side effect will NOT happen and Screen1 always displays the button (even when returning from Screen2).
Screen2View::buffer[1736] is exactly the spot in memory where Screen1ViewBase::cacheableContainer will live later on.
Any more explanations needed?
2020-11-19 01:59 AM
Thanks, Klemens. Downloaded. I'll check it out!