GNOME Bugzilla – Bug 774634
GtkPlacesView does not unref all GDaemonFileEnumerator it references
Last modified: 2016-11-17 18:54:58 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 *dialog = gtk_file_chooser_dialog_new ("Open File", NULL, GTK_FILE_CHOOSER_ACTION_OPEN, "Cancel", GTK_RESPONSE_CANCEL, NULL); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } return 0; } the number of objects alive at exit increases for the presence of a GDaemonFileEnumerator. The object is created here: https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacesview.c?h=gtk-3-22#n994 Comparing the file_enumerator API usage in gtk/gtkfilesystemmodel.c https://git.gnome.org/browse/gtk+/tree/gtk/gtkfilesystemmodel.c?h=gtk-3-22#n1282 it seems that 'enumerator' should be unreffed after the call to g_file_enumerator_next_files_async https://git.gnome.org/browse/gtk+/tree/gtk/gtkplacesview.c?h=gtk-3-22#n1014
Thanks so much for filing all these high-quality bug reports. It is really appreciated!