Merge branch 'a11y-crash' into 'master'

A11y crash

Closes #3014

See merge request GNOME/gtk!2364
This commit is contained in:
Matthias Clasen 2020-08-04 15:47:36 +00:00
commit a42738729b
2 changed files with 13 additions and 10 deletions

View File

@ -4195,7 +4195,10 @@ gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window,
NULL);
}
list = g_list_append (NULL, priv->child);
if (priv->child)
list = g_list_append (NULL, priv->child);
else
list = NULL;
gtk_accessible_update_relation (GTK_ACCESSIBLE (priv->hscrollbar),
GTK_ACCESSIBLE_RELATION_CONTROLS, list,
-1);

View File

@ -49,16 +49,16 @@ gtk_test_at_context_state_change (GtkATContext *self,
GtkAccessibleAttributeSet *properties,
GtkAccessibleAttributeSet *relations)
{
char *states_str = gtk_accessible_attribute_set_to_string (states);
char *properties_str = gtk_accessible_attribute_set_to_string (properties);
char *relations_str = gtk_accessible_attribute_set_to_string (relations);
GTK_NOTE(A11Y,
if (GTK_DEBUG_CHECK (A11Y))
{
char *states_str = gtk_accessible_attribute_set_to_string (states);
char *properties_str = gtk_accessible_attribute_set_to_string (properties);
char *relations_str = gtk_accessible_attribute_set_to_string (relations);
GtkAccessibleRole role = gtk_at_context_get_accessible_role (self);
GtkAccessible *accessible = gtk_at_context_get_accessible (self);
GEnumClass *class = g_type_class_ref (GTK_TYPE_ACCESSIBLE_ROLE);
GEnumValue *value = g_enum_get_value (class, role);
g_print ("*** Accessible state changed for accessible “%s”, with role “%s” (%d):\n"
"*** states = %s\n"
"*** properties = %s\n"
@ -70,11 +70,11 @@ gtk_test_at_context_state_change (GtkATContext *self,
properties_str,
relations_str);
g_type_class_unref (class);
});
g_free (states_str);
g_free (properties_str);
g_free (relations_str);
g_free (states_str);
g_free (properties_str);
g_free (relations_str);
}
}
static void