diff options
author | Mike Gorse <mgorse@suse.com> | 2013-08-30 09:13:39 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2013-08-31 16:42:07 -0500 |
commit | 3f2aacca526c6b4c1eda99b684f273c0a32449bc (patch) | |
tree | 8fdc0afb7d272435fc63b2443b5bd1801be4f975 /gtk/a11y | |
parent | 89214cad5b19f760ea0508fd2418a540744f3660 (diff) | |
download | gtk+-3f2aacca526c6b4c1eda99b684f273c0a32449bc.tar.gz |
a11y: Check whether a widget is mapped before querying its parent
Call gtk_widget_get_mapped() in a couple of places before looking at the
widget's parent, since it might be set to a widget that has been
finalized, causing an invalid read.
Diffstat (limited to 'gtk/a11y')
-rw-r--r-- | gtk/a11y/gtkwidgetaccessible.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c index 841ae14e3c..3572e42a17 100644 --- a/gtk/a11y/gtkwidgetaccessible.c +++ b/gtk/a11y/gtkwidgetaccessible.c @@ -271,7 +271,7 @@ gtk_widget_accessible_ref_relation_set (AtkObject *obj) label = find_label (widget); if (label == NULL) { - if (GTK_IS_BUTTON (widget)) + if (GTK_IS_BUTTON (widget) && gtk_widget_get_mapped (widget)) /* * Handle the case where GnomeIconEntry is the mnemonic widget. * The GtkButton which is a grandchild of the GnomeIconEntry @@ -781,6 +781,9 @@ gtk_widget_accessible_on_screen (GtkWidget *widget) gtk_widget_get_allocation (widget, &allocation); + if (!gtk_widget_get_mapped (widget)) + return FALSE; + viewport = gtk_widget_get_ancestor (widget, GTK_TYPE_VIEWPORT); if (viewport) { |