----- Original Message ---- From: ere wer <[EMAIL PROTECTED]> To: clutter <[email protected]> Sent: Friday, September 5, 2008 4:50:34 PM Subject: [VALA] Potentional memory leak with Container.get_childern Right now calling, for instance weak GLib.List l = this.get_childernen creates GList* children = clutter_container_get_children (CLUTTER_CONTAINER (self)); ***but it clutter_container_get_children returns a copy of the list, and it must be freed,as it is suggested by the documentation: "clutter_container_get_children () ... Returns : a list of ClutterActors. Use g_list_free() on the returned list when done" The workaround is to manually memory manage the list: GLib.List* children ... delete children creates the expected : GList* children = clutter_container_get_children (CLUTTER_CONTAINER (self)); ... g_list_free(children); Im I doing something wrong? And also, which is the right way to create and use the list; GLib.List children MihailNaydnov sorry for the dabble post :( I pressed CTRL+ENTER by incident in Yahoo mail here my last question: And also, which is the right way to create and use the list: Lib.List* children; Actor child = (Actor)children->data; or Lib.List<Actor>* children; Actor child = children->data; Doing the later seams the right thing, but it creates some weird casting and I had some crashes using this approach 10x MihailNajdenov PS test-layout.c in clutter/tests also forgets to remove the list at line 676 -- To unsubscribe send a mail to [EMAIL PROTECTED]
