diff options
author | Benjamin Otte <otte@redhat.com> | 2015-03-18 18:22:17 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-03-18 18:24:45 +0100 |
commit | ec57c6c10b3a0774a27e11a9279a25b90ce76ed4 (patch) | |
tree | 2bf1d0b3c87a525c1034fcc2cfbd471a786ca517 /gtk/gtkcsspathnode.c | |
parent | d55c261079370e3ddd61f3dab6bea9067380480e (diff) | |
download | gtk+-ec57c6c10b3a0774a27e11a9279a25b90ce76ed4.tar.gz |
csspathnode: Handle context going away
Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.
Fixes startup of mutter.
Testcase included.
https://bugzilla.gnome.org/show_bug.cgi?id=746407
Diffstat (limited to 'gtk/gtkcsspathnode.c')
-rw-r--r-- | gtk/gtkcsspathnode.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkcsspathnode.c b/gtk/gtkcsspathnode.c index e9b5298733..fecb4552a9 100644 --- a/gtk/gtkcsspathnode.c +++ b/gtk/gtkcsspathnode.c @@ -157,6 +157,17 @@ gtk_css_path_node_new (GtkStyleContext *context) } void +gtk_css_path_node_unset_context (GtkCssPathNode *node) +{ + gtk_internal_return_if_fail (GTK_IS_CSS_PATH_NODE (node)); + gtk_internal_return_if_fail (node->context != NULL); + + node->context = NULL; + + gtk_css_node_invalidate_style_provider (GTK_CSS_NODE (node)); +} + +void gtk_css_path_node_set_widget_path (GtkCssPathNode *node, GtkWidgetPath *path) { |