g_list_free()



Hi,

Just wanted to know if g_list_free() frees the memory allocated "by hand" and attached to the list nodes.
For example:

---[ start code ]---

GList *list = NULL;
typedef struct {
   gchar *name;
   gint age;
} Person *bush;

bush->name = g_strdup ("George");
bush->age = 8;

list = g_list_append (list, (gpointer) bush);
g_list_free (list);
list = NULL;

---[ end code ]---

Is this a memory leak? In other words: does the above g_list_free() free the string allocated in bush->name ?


Thanks.


*
Maulet



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