Commit 5a41f634 authored by Jasper St. Pierre's avatar Jasper St. Pierre

gtkstylecontext: Don't try to emit a signal when finalizing

parent ecc64f63
...@@ -522,6 +522,18 @@ _gtk_style_context_update_animating (GtkStyleContext *context) ...@@ -522,6 +522,18 @@ _gtk_style_context_update_animating (GtkStyleContext *context)
gtk_style_context_stop_animating (context); gtk_style_context_stop_animating (context);
} }
static void
gtk_style_context_clear_parent (GtkStyleContext *context)
{
GtkStyleContextPrivate *priv = context->priv;
if (priv->parent)
{
priv->parent->priv->children = g_slist_remove (priv->parent->priv->children, context);
g_object_unref (priv->parent);
}
}
static void static void
gtk_style_context_finalize (GObject *object) gtk_style_context_finalize (GObject *object)
{ {
...@@ -536,7 +548,7 @@ gtk_style_context_finalize (GObject *object) ...@@ -536,7 +548,7 @@ gtk_style_context_finalize (GObject *object)
/* children hold a reference to us */ /* children hold a reference to us */
g_assert (priv->children == NULL); g_assert (priv->children == NULL);
gtk_style_context_set_parent (style_context, NULL); gtk_style_context_clear_parent (style_context);
gtk_style_context_set_cascade (style_context, NULL); gtk_style_context_set_cascade (style_context, NULL);
...@@ -1397,11 +1409,7 @@ gtk_style_context_set_parent (GtkStyleContext *context, ...@@ -1397,11 +1409,7 @@ gtk_style_context_set_parent (GtkStyleContext *context,
gtk_style_context_set_invalid (parent, TRUE); gtk_style_context_set_invalid (parent, TRUE);
} }
if (priv->parent) gtk_style_context_clear_parent (context);
{
priv->parent->priv->children = g_slist_remove (priv->parent->priv->children, context);
g_object_unref (priv->parent);
}
priv->parent = parent; priv->parent = parent;
......
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