GNOME Bugzilla – Bug 774743
GtkNotebook does not unref all GtkBuiltinIcon it creates
Last modified: 2016-11-23 19:45:27 UTC
After setting GOBJECT_DEBUG=objects comparing the outputs of the following program run with ITERATIONS set to 2 and 1: #include <gtk/gtk.h> #ifndef ITERATIONS #define ITERATIONS 2 #endif int main (int argc, char *argv[]) { int i; if (gtk_init_check (&argc, &argv)) for (i = 0; i < ITERATIONS; ++i) { GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); GtkWidget *notebook = gtk_notebook_new (); GtkWidget *page = gtk_drawing_area_new (); gtk_container_add (GTK_CONTAINER (window), notebook); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, NULL); gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); gtk_widget_destroy (window); } return 0; } the number of objects alive at exit increases for the presence of few GtkBuiltinIcon objects. The problem is here: https://git.gnome.org/browse/gtk+/tree/gtk/gtknotebook.c?h=gtk-3-22#n1843 in gtk_notebook_finalize priv->{,header_,tabs_,stack_}gadget are cleared, but priv->arrow_gadget[0-4] not.