Skip to main content
Klemens_Pleiner_STE
Associate II
Question

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

This topic has been closed for replies.

7 replies

Martin KJELDSEN
Principal III

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

Klemens_Pleiner_STE
Associate II

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:

  • Enter a page where a CacheableContainer is used.
  • Enter another page that uses that bit of memory where the CacheableContainer resided in. This new page must set that region of memory to 0 where cachedBitmapId resided.
  • Return to the first Screen. CacheableContainer::cachedBitmapId is not initialized and thus it uses the value 0.

Just tell me, if you really need such an example.

KR, Klemens

Martin KJELDSEN
Principal III

​Please do! Thanks :)

Romain DIELEMAN
ST Employee

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

Klemens_Pleiner_STE
Associate II