Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2250
This commit is contained in:
Matthias Clasen
2020-07-16 17:39:16 +00:00
11 changed files with 29 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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));
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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 *

View File

@@ -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

View File

@@ -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 *

View File

@@ -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);