diff --git a/gtk/gtkapplicationaccels.c b/gtk/gtkapplicationaccels.c index de4aafe378..cdbaafe3cb 100644 --- a/gtk/gtkapplicationaccels.c +++ b/gtk/gtkapplicationaccels.c @@ -109,6 +109,7 @@ gtk_application_accels_set_accels_for_action (GtkApplicationAccels *accels, } g_list_store_remove (G_LIST_STORE (accels->shortcuts), i); + g_object_unref (shortcut_i); break; } diff --git a/gtk/gtkcolumnlistitemfactory.c b/gtk/gtkcolumnlistitemfactory.c index 0b2151f12f..e6188cb4d4 100644 --- a/gtk/gtkcolumnlistitemfactory.c +++ b/gtk/gtkcolumnlistitemfactory.c @@ -62,10 +62,12 @@ gtk_column_list_item_factory_setup (GtkListItemFactory *factory, { GtkColumnViewColumn *column = g_list_model_get_item (columns, i); - gtk_column_list_item_factory_add_column (self, + gtk_column_list_item_factory_add_column (self, list_item->owner, column, FALSE); + + g_object_unref (column); } } diff --git a/gtk/gtkcolumnviewsorter.c b/gtk/gtkcolumnviewsorter.c index 587731e1cd..fa8cf8607a 100644 --- a/gtk/gtkcolumnviewsorter.c +++ b/gtk/gtkcolumnviewsorter.c @@ -115,6 +115,14 @@ gtk_column_view_sorter_dispose (GObject *object) { GtkColumnViewSorter *self = GTK_COLUMN_VIEW_SORTER (object); + /* The sorter is owned by the columview and is unreffed + * after the columns, so the sequence must be empty at + * this point. + * The sorter can outlive the columview it comes from + * (the model might still have a ref), but that does + * not change the fact that all columns will be gone. + */ + g_assert (g_sequence_is_empty (self->sorters)); g_clear_pointer (&self->sorters, g_sequence_free); G_OBJECT_CLASS (gtk_column_view_sorter_parent_class)->dispose (object); diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c index 68076989fc..7bb3e54b36 100644 --- a/gtk/gtkfilechoosernativewin32.c +++ b/gtk/gtkfilechoosernativewin32.c @@ -906,6 +906,7 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self) filechooser_win32_thread_data_free (data); return FALSE; } + g_object_unref (filter); } self->current_filter = gtk_file_chooser_get_filter (GTK_FILE_CHOOSER (self)); } diff --git a/gtk/gtkflattenlistmodel.c b/gtk/gtkflattenlistmodel.c index fe681b265e..f4398d853c 100644 --- a/gtk/gtkflattenlistmodel.c +++ b/gtk/gtkflattenlistmodel.c @@ -300,7 +300,7 @@ gtk_flatten_list_model_add_items (GtkFlattenListModel *self, G_CALLBACK (gtk_flatten_list_model_items_changed_cb), node); node->list = self; - added +=g_list_model_get_n_items (node->model); + added += g_list_model_get_n_items (node->model); } return added; diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 7c528252e2..e22d1ca188 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -767,6 +767,8 @@ add_application_shortcuts (GtkPlacesSidebar *sidebar) GFile *file = g_list_model_get_item (G_LIST_MODEL (sidebar->shortcuts), i); ShortcutData *data; + g_object_unref (file); + if (!should_show_file (sidebar, file)) continue; diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index dab4548b49..38f35a0b87 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -3009,6 +3009,8 @@ paper_size_changed (GtkDropDown *combo_box, gtk_window_present (GTK_WINDOW (custom_paper_dialog)); G_GNUC_END_IGNORE_DEPRECATIONS + g_object_unref (page_setup); + return; } diff --git a/testsuite/gtk/filter.c b/testsuite/gtk/filter.c index 5c5fd707c7..2e88a21f7a 100644 --- a/testsuite/gtk/filter.c +++ b/testsuite/gtk/filter.c @@ -28,8 +28,11 @@ get (GListModel *model, guint position) { GObject *object = g_list_model_get_item (model, position); + guint ret; g_assert (object != NULL); - return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark)); + ret = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark)); + g_object_unref (object); + return ret; } static char * diff --git a/testsuite/gtk/filterlistmodel-exhaustive.c b/testsuite/gtk/filterlistmodel-exhaustive.c index 00be63ba08..ec1cbecc32 100644 --- a/testsuite/gtk/filterlistmodel-exhaustive.c +++ b/testsuite/gtk/filterlistmodel-exhaustive.c @@ -38,6 +38,8 @@ g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, _s); \ g_free (_s); \ } \ + g_object_unref (o1); \ + g_object_unref (o2); \ } \ }G_STMT_END diff --git a/testsuite/gtk/multiselection.c b/testsuite/gtk/multiselection.c index 970a6c4a6a..7d67f3ca3d 100644 --- a/testsuite/gtk/multiselection.c +++ b/testsuite/gtk/multiselection.c @@ -29,8 +29,11 @@ get (GListModel *model, guint position) { GObject *object = g_list_model_get_item (model, position); + guint ret; g_assert (object != NULL); - return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark)); + ret = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark)); + g_object_unref (object); + return ret; } static char * diff --git a/testsuite/gtk/treesorter.c b/testsuite/gtk/treesorter.c index 6d1e314d30..59a32b5e25 100644 --- a/testsuite/gtk/treesorter.c +++ b/testsuite/gtk/treesorter.c @@ -69,6 +69,7 @@ model_to_string (GListModel *model) if (i > 0) g_string_append (string, " "); g_string_append_printf (string, "%u", get_with_parents (object)); + /* no unref since get_with_parents consumes the ref */ } return g_string_free (string, FALSE);