RE: GtkCList memory management



Usually, i do:

gchar *fields[2] = {NULL,NULL};
fields[0] = g_strdup_printf("hello");
fields[1] = g_strdup_printf("world");

gtk_clist_append(mylist,fields);

g_free(fields[0]);
g_free(fields[1]);


- Thats all that is needed because you are creating the memory and freeing
YOUR memory after it has been handed to GTK.  If you are still concerned
that GTK is not freeing the memory, I would recommend that you write to the
gtk development mailing list, and ask them.  

Regards,

Martyn

-----Original Message-----
From: Alejandro García Castro [mailto:alex igalia com]
Sent: Tuesday, April 23, 2002 3:29 PM
To: martyn 2 russell bt com
Cc: gtk-app-devel-list gnome org
Subject: Re: GtkCList memory management


On Tue, Apr 23, 2002 at 10:47:25AM +0100, martyn 2 russell bt com wrote:
If so, that is a problem in GTK not your code.  You are responsible for
cleaning up all the memory you create and GTK is responsible for cleaning
up
all the memory it makes.  If you call a GTK function passing data, it will
take its own copy and manage it.  


Thanks for your answer Martyn. Trying to find how can I free the mem I 
made a simple example that creates a GtkList, fills it with rows and 
then destroys the object. After this the memory use continues to 
be the same, even after the destruction, this is what my top says. 
Is there a reference I should unref somewhere? Should I put an 
advise in bugzilla? 

Greetings.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]