Bug: CacheableContainer::cachedBitmapId is not initialized by constructor
Hi,
I came across the missing implementation of CacheableContainer::cachedBitmapId in the following situation:
- My application starts with a screen where CacheableContainers are used. This first time everything works fine.
- Then the application switches to another screen.
- The other screen switches back to the first screen with the CacheableContainers. Now nothing is displayed for the CacheableContainers :(
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