summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-12-28 18:11:49 -0800
committerJasper St. Pierre <jstpierre@mecheye.net>2014-12-28 18:13:34 -0800
commit5a41f63426efb6f715119d23acdab0b2676c72ad (patch)
tree3b838ded84061b1be959a67b628c5a20be6b2d72 /gtk
parentecc64f63e4797e564d2d9057eb0f7b6b476ec2b2 (diff)
downloadgtk+-5a41f63426efb6f715119d23acdab0b2676c72ad.tar.gz
gtkstylecontext: Don't try to emit a signal when finalizing
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkstylecontext.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 77739972ec..fcc127013e 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -523,6 +523,18 @@ _gtk_style_context_update_animating (GtkStyleContext *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
gtk_style_context_finalize (GObject *object)
{
GtkStyleContextPrivate *priv;
@@ -536,7 +548,7 @@ gtk_style_context_finalize (GObject *object)
/* children hold a reference to us */
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);
@@ -1397,11 +1409,7 @@ gtk_style_context_set_parent (GtkStyleContext *context,
gtk_style_context_set_invalid (parent, TRUE);
}
- if (priv->parent)
- {
- priv->parent->priv->children = g_slist_remove (priv->parent->priv->children, context);
- g_object_unref (priv->parent);
- }
+ gtk_style_context_clear_parent (context);
priv->parent = parent;