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
This commit is contained in:
Benjamin Otte 2012-03-09 12:35:58 +01:00
parent 9d1688680c
commit 5d57981184

View File

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