GNOME Bugzilla – Bug 775470
GdkWindow does not always unref all GdkFrameClockIdle it creates
Last modified: 2016-12-01 17:30:09 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 1 #endif int main (int argc, char *argv[]) { if (gtk_init_check (&argc, &argv)) { int i; for (i = 0; i < ITERATIONS; ++i) { GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new ("Open File", NULL, GTK_FILE_CHOOSER_ACTION_OPEN, "Cancel", GTK_RESPONSE_CANCEL, NULL); gtk_widget_show_all (dialog); gtk_widget_destroy (dialog); } } return 0; } on Wayland the number of objects alive at exit increases for the presence of few GdkFrameClockIdle objects. The problem is that on Wayland popover GdkWindow have window_type GDK_WINDOW_SUBSURFACE https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c?h=gtk-3-22#n6647 and gdk_window_destroy (_gdk_window_destroy_hierarchy) does nearly nothing for this kind of GdkWindow: https://git.gnome.org/browse/gtk+/tree/gdk/gdkwindow.c?h=gtk-3-22#n2019 in particular it does not unref GdkFrameClockIdle objects it creates.
(In reply to Massimo from comment #0) > [...] > The problem is that on Wayland popover GdkWindow have window_type > GDK_WINDOW_SUBSURFACE > > and gdk_window_destroy (_gdk_window_destroy_hierarchy) does nearly nothing > for this kind of GdkWindow: > [...] In current master and gtk-3-22 git branch, this is not the case anymore, does commit 893ed4e from bug 774915 help here?
Ah! my bad, the patch is not reviewed/merged yet, so I guess this might be a duplicate of bug 774915, can you try attachment 340598 [details] [review] to see if this helps here as well?
(In reply to Olivier Fourdan from comment #2) > Ah! my bad, the patch is not reviewed/merged yet, so I guess this might be a > duplicate of bug 774915, can you try attachment 340598 [details] [review] [review] to > see if this helps here as well? yes that attachment would fix the problem.
With attachment 340598 [details] [review] I see "GdkFrameClockIdle ref_count=1" in all cases (ITERATIONS=1, ITERATIONS=2 and even ITERATIONS=100)
*** This bug has been marked as a duplicate of bug 774915 ***
(In reply to Olivier Fourdan from comment #4) > With attachment 340598 [details] [review] [review] I see "GdkFrameClockIdle > ref_count=1" in all cases (ITERATIONS=1, ITERATIONS=2 and even > ITERATIONS=100) Yes and without that patch there are 5 such lines with ITERATIONS=1 and 9 with ITERATIONS=2