[gtk] assistant: Fix a refcounting oversight
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] assistant: Fix a refcounting oversight
- Date: Fri, 8 Feb 2019 14:57:02 +0000 (UTC)
commit c16a861f6811ef3c2013101694f80107422912d1
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 8 09:49:54 2019 -0500
assistant: Fix a refcounting oversight
The assistant needs to hold a ref on the pages.
gtk/gtkassistant.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 12c38ea43f..f20bbe0428 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1773,6 +1773,8 @@ gtk_assistant_insert_page (GtkAssistant *assistant,
page_info->has_padding = TRUE;
return gtk_assistant_add_page (assistant, page_info, position);
+
+ g_object_unref (page_info);
}
static int
@@ -1815,7 +1817,7 @@ gtk_assistant_add_page (GtkAssistant *assistant,
if (position < 0 || position > n_pages)
position = n_pages;
- priv->pages = g_list_insert (priv->pages, page_info, position);
+ priv->pages = g_list_insert (priv->pages, g_object_ref (page_info), position);
if (position == 0)
sibling = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]