RE: GtkCList memory management



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.  

Martyn

-----Original Message-----
From: Alejandro García Castro [mailto:acastro igalia com]
Sent: Monday, April 22, 2002 1:50 PM
To: gtk-app-devel-list gnome org
Subject: GtkCList memory management



Hi,

Im developing an application using gtk+1.2.10-10 and I have problems trying
to free
the memory used by the GtkCList. I been using gtk+/gnome development
environment
just for some weeks, so Im not even sure about the use of the GtkCList
functions.
The way I use the API is:

...
/* Add rows to the CList */
gtk_clist_append (GtkCList *clist, gchar *text[]); 
...
/* Change text of one cell */
gtk_clist_set_tex (GtkCList *clist, gint row, gint column, const gchar
*text);
...
/* Clear the entire CList */
gtk_clist_clear ((tkCList *clist);
...

The problem is that gtk_clist_clear doesnt free the memory. Ive looked the
source
of the library (gtkclist.c) and the way it does the clean is using the
function 
g_mem_chunk_free. I made a little program with the functions of the
GMemChunk API, 
and that function seems not to free the memory, just takes out an atom. I
had to use
g_mem_chunk_reset after g_mem_chunk_free to free the memory properly. Just
guessing
if this could be a problem.

Ive looked some code that uses GtkCList (Evolution), and it seems it uses
the 
library same way. I would like to know if Im using the GtkClists properly.
Any help 
would be appreciated.

Thanks in advance.

Greetings.

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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