mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
stack: Don't recreate at contexts in dispose
This is the same protection we have in GtkWidgetAccessible.
This commit is contained in:
parent
500128d186
commit
611788fb53
@ -219,6 +219,7 @@ struct _GtkStackPage
|
|||||||
guint needs_attention : 1;
|
guint needs_attention : 1;
|
||||||
guint visible : 1;
|
guint visible : 1;
|
||||||
guint use_underline : 1;
|
guint use_underline : 1;
|
||||||
|
guint in_destruction : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _GtkStackPageClass GtkStackPageClass;
|
typedef struct _GtkStackPageClass GtkStackPageClass;
|
||||||
@ -235,6 +236,14 @@ gtk_stack_page_accessible_get_at_context (GtkAccessible *accessible)
|
|||||||
{
|
{
|
||||||
GtkStackPage *page = GTK_STACK_PAGE (accessible);
|
GtkStackPage *page = GTK_STACK_PAGE (accessible);
|
||||||
|
|
||||||
|
if (page->in_destruction)
|
||||||
|
{
|
||||||
|
GTK_DEBUG (A11Y, "ATContext for “%s” [%p] accessed during destruction",
|
||||||
|
G_OBJECT_TYPE_NAME (accessible),
|
||||||
|
accessible);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (page->at_context == NULL)
|
if (page->at_context == NULL)
|
||||||
{
|
{
|
||||||
GtkAccessibleRole role = GTK_ACCESSIBLE_ROLE_TAB_PANEL;
|
GtkAccessibleRole role = GTK_ACCESSIBLE_ROLE_TAB_PANEL;
|
||||||
@ -353,6 +362,8 @@ gtk_stack_page_dispose (GObject *object)
|
|||||||
{
|
{
|
||||||
GtkStackPage *page = GTK_STACK_PAGE (object);
|
GtkStackPage *page = GTK_STACK_PAGE (object);
|
||||||
|
|
||||||
|
page->in_destruction = TRUE;
|
||||||
|
|
||||||
g_clear_object (&page->at_context);
|
g_clear_object (&page->at_context);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gtk_stack_page_parent_class)->dispose (object);
|
G_OBJECT_CLASS (gtk_stack_page_parent_class)->dispose (object);
|
||||||
|
Loading…
Reference in New Issue
Block a user