I haven't looked at this in depth yet, but pgLeaveContext should treat
all handles equally. Every handle has a 'context number' attached.
pgEnterContext increments the number assigned to new handles.
pgLeaveContext finds all the handles with a matching context number and
frees them.

If you can, try using memprof to track down the source of the leak.

--Micah

On Wed, Sep 03, 2003 at 07:32:51PM +0300, Olcay Korol wrote:
> 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.
> 
> 
> 



-- 
Only you can prevent creeping featurism!


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel

Reply via email to