summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-10-28 16:50:10 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-10-28 16:50:10 +0000
commitb6aa6f0fa9e36cdcacd608f55eb2031a0382dc2b (patch)
treedc1f274c495b18941f97e62981e9907a5df00db5 /gtk/gtkcombobox.c
parentd5f92150d4b8bffb78cd5110cbb2c28bfdf81136 (diff)
downloadgdk-pixbuf-b6aa6f0fa9e36cdcacd608f55eb2031a0382dc2b.tar.gz
Use g_signal_connect_object() to prevent premature finalization of the
2004-10-28 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcombobox.c (gtk_combo_box_start_editing): Use g_signal_connect_object() to prevent premature finalization of the cell_editable while the key_press_event signal is handled. (#156325, Olivier Andrieu)
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 14c5ad47c..f6dace279 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -4714,10 +4714,8 @@ gtk_cell_editable_key_press (GtkWidget *widget,
}
else if (event->keyval == GDK_Return)
{
- if (GTK_IS_CELL_EDITABLE (combo_box))
- gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
- if (GTK_IS_CELL_EDITABLE (combo_box))
- gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));
+ gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
+ gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (combo_box));
return TRUE;
}
@@ -4785,17 +4783,17 @@ gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
if (combo_box->priv->cell_view)
{
- g_signal_connect (combo_box->priv->button, "key_press_event",
- G_CALLBACK (gtk_cell_editable_key_press),
- cell_editable);
+ g_signal_connect_object (combo_box->priv->button, "key_press_event",
+ G_CALLBACK (gtk_cell_editable_key_press),
+ cell_editable, 0);
gtk_widget_grab_focus (combo_box->priv->button);
}
else
{
- g_signal_connect (GTK_BIN (combo_box)->child, "key_press_event",
- G_CALLBACK (gtk_cell_editable_key_press),
- cell_editable);
+ g_signal_connect_object (GTK_BIN (combo_box)->child, "key_press_event",
+ G_CALLBACK (gtk_cell_editable_key_press),
+ cell_editable, 0);
gtk_widget_grab_focus (GTK_WIDGET (GTK_BIN (combo_box)->child));
GTK_WIDGET_UNSET_FLAGS (combo_box->priv->button, GTK_CAN_FOCUS);