public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* gtk-container-children memory leak
@ 2003-01-24 15:05 Kevin Ryde
  2003-06-19  1:14 ` Kevin Ryde
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2003-01-24 15:05 UTC (permalink / raw)
  To: guile-gtk

I think gtk-container-children might be leaking memory.  On a recent
i386 debian and my build of guile 1.6.1, the following little program
uses an apparently ever increasing amount of core (as shown by the
"top" program).

    (use-modules (gtk gtk))
    (define toplevel (gtk-window-new 'toplevel))
    (gtk-container-add toplevel (gtk-label-new "foo"))
    (while #t
           (gtk-container-children toplevel))

I think gtk_container_children allocates a fresh GList for its return,
which the caller is supposed to free.  As far as I can tell that
doesn't happen in gtk-glue.c etc.

Inserting a g_list_free manually into sgtk_gtk_container_children
seems to do the trick, but I'm not smart enough to tell how to get
that done properly.

It'd probably be good to allow either freeing or not.
gtk_container_children and a prospective gdk_list_visuals should free,
gtk_radio_button_group (which is a GSList) and a prospective
gdk_window_peek_children (implementing gtk-window-children) shouldn't.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-06-19  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24 15:05 gtk-container-children memory leak Kevin Ryde
2003-06-19  1:14 ` Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).