diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c index 33ad641065..204fc6f5bc 100644 --- a/gtk/gtkfilefilter.c +++ b/gtk/gtkfilefilter.c @@ -90,12 +90,12 @@ typedef enum { struct _GtkFileFilterClass { - GInitiallyUnownedClass parent_class; + GObjectClass parent_class; }; struct _GtkFileFilter { - GInitiallyUnowned parent_instance; + GObject parent_instance; gchar *name; GSList *rules; @@ -156,7 +156,7 @@ static void gtk_file_filter_buildable_custom_tag_end (GtkBuildable const gchar *tagname, gpointer data); -G_DEFINE_TYPE_WITH_CODE (GtkFileFilter, gtk_file_filter, G_TYPE_INITIALLY_UNOWNED, +G_DEFINE_TYPE_WITH_CODE (GtkFileFilter, gtk_file_filter, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_file_filter_buildable_init)) diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 71c0358af3..1dca027ecc 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -393,6 +393,7 @@ main (int argc, char **argv) /* Make this filter the default */ gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "No backup files"); @@ -400,11 +401,13 @@ main (int argc, char **argv) no_backup_files_filter, NULL, NULL); gtk_file_filter_add_mime_type (filter, "image/png"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Starts with D"); gtk_file_filter_add_pattern (filter, "D*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); g_signal_connect (dialog, "notify::filter", G_CALLBACK (filter_changed), NULL); @@ -414,11 +417,13 @@ main (int argc, char **argv) gtk_file_filter_add_mime_type (filter, "image/jpeg"); gtk_file_filter_add_mime_type (filter, "image/png"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Images"); gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + g_object_unref (filter); /* Choices */ diff --git a/tests/testgtk.c b/tests/testgtk.c index 791ea10f46..10507a3f3a 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -5692,17 +5692,20 @@ native_filter_changed (GtkWidget *combo, gtk_file_filter_add_pattern (filter, "*.doc"); gtk_file_filter_add_pattern (filter, "*.txt"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "Images"); gtk_file_filter_add_pixbuf_formats (filter); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "All"); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); break; case 2: /* mimetype */ @@ -5710,12 +5713,14 @@ native_filter_changed (GtkWidget *combo, gtk_file_filter_set_name (filter, "Text"); gtk_file_filter_add_mime_type (filter, "text/plain"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, "All"); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (native), filter); gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (native), filter); + g_object_unref (filter); break; default: g_assert_not_reached ();