Hi all,

I have a problem using bitmaps. 

I attached a simple piece of code describing that situation. It works on 
an SA1110-based system with 2.4.9 kernel and with PicoGUI version 0.45. This
app puts two buttons on screen. The one the right is used to kill the app.
The one on the left, when clicked, opens a popup with a list of menuitems. 
Each menuitem contains a bitmap image. This menu is closed whenever one of 
the menuitems is clicked. When i measure free memory in the system (using 
shell command free), i see that every opening and closing of the menu spends 
4kB of memory. No memory is spent when there is no bitmap.

I'm very careful with "my own allocations", it is obvious that this loss cannot 
be due to malloc stuff in my code.

It seems that pgLeaveContext frees memory only for widgets and strings, not for 
bitmaps. It probably only marks the handle as unused, but does not" physically" 
free the memory.

If pgLeaveContext did free that piece of memory, there wouldn't be any memory 
leak. If not, how can i free that piece of memory when i'm finished with bitmaps? 
That's very important cause we can have so many open/close operations with menus of 
this kind in a bigger application. 

Any help is appreciated,

Olcay Korol
Department of R&D
Eliar A.S.



Attachment: main.c
Description: Binary data

Reply via email to