[Glade-users] memory management for treeview in dialog

Damon Chaplin damon at karuna.uklinux.net
Thu Aug 11 07:30:36 EDT 2005


On Thu, 2005-08-11 at 16:32 +1000, kadil wrote:
> I have been experimenting with a treeview in dialog, and have created a memory 
> leak.  I am using glade to create code, not xml. My steps are:
> 
> (1) create the dialog
> (2) show the dialog
> (3) create a new tree store
> (4) create a sort model
> (5) add columns
> (6) append rows & populate them
> (7) when the user closes the dialog, I unref the model and sortmodel and I 
> destroy the dialog widget
> 
> Each time I repeat creating the dialog, windows task manager memory graph 
> shows more memory being consumed.
> 
> Can anyone please explain if there is any glaring issues with my process. It 
> is possible my process for appending the rows( step 6 )may be at fault.

It looks OK. It looks like you've unref'ed all the objects properly.

On Linux you could use valgrind to spot a memory leak quite easily.
I don't know if there are free tools like that on windows.

Try simplifying the app (e.g. don't append the rows), and see if the
memory behavior is different.

It could just be fragmented memory rather than a leak.

Damon




More information about the Glade-users mailing list