Commit 283c9746 authored by Simon Feltman's avatar Simon Feltman

gtkcellrenderertext: Sink floating entry before using as signal argument

Sink the GtkEntry assigned to the private structure of GtkCellRendererText
before signals containing it as an argument are sent out. This keeps
language bindings from sinking the reference and then destroying the entry
when the signal closure is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=693400
parent 154a144c
......@@ -751,6 +751,8 @@ gtk_cell_renderer_text_finalize (GObject *object)
if (priv->language)
g_object_unref (priv->language);
g_clear_object (&priv->entry);
G_OBJECT_CLASS (gtk_cell_renderer_text_parent_class)->finalize (object);
}
......@@ -1915,7 +1917,7 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry,
priv = GTK_CELL_RENDERER_TEXT (data)->priv;
priv->entry = NULL;
g_clear_object (&priv->entry);
if (priv->focus_out_id > 0)
{
......@@ -2047,6 +2049,8 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
priv->entry = gtk_entry_new ();
g_object_ref_sink (G_OBJECT (priv->entry));
gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment