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
This commit is contained in:
@ -156,6 +156,17 @@ gtk_css_path_node_new (GtkStyleContext *context)
|
||||
return GTK_CSS_NODE (node);
|
||||
}
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user