From 5d579811843f81db9866ac81afc5297f776cfb3b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Mar 2012 12:35:58 +0100 Subject: [PATCH] widget: Set up signals after initializing style context Otherwise, signals would be emitted on semi set up style context which would then cause crashes when the signal handlers tried to use them. https://bugzilla.gnome.org/show_bug.cgi?id=662023 --- gtk/gtkwidget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index c4c85c9e0c..a82f05023a 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -14119,9 +14119,6 @@ gtk_widget_get_style_context (GtkWidget *widget) "direction", gtk_widget_get_direction (widget), NULL); - g_signal_connect (widget->priv->context, "changed", - G_CALLBACK (style_context_changed), widget); - screen = gtk_widget_get_screen (widget); if (screen) @@ -14131,6 +14128,9 @@ gtk_widget_get_style_context (GtkWidget *widget) if (priv->parent) gtk_style_context_set_parent (priv->context, gtk_widget_get_style_context (priv->parent)); + + g_signal_connect (widget->priv->context, "changed", + G_CALLBACK (style_context_changed), widget); } return widget->priv->context;