[gtk+] a11y: unref selected item only if it is not NULL
- From: Alejandro Piñeiro Iglesias <apinheiro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: unref selected item only if it is not NULL
- Date: Fri, 25 Jul 2014 08:05:41 +0000 (UTC)
commit 2be4474a19d16a1a4862d730f5114169b1ccf5ed
Author: Alejandro Piñeiro <apinheiro igalia com>
Date: Wed Jul 23 17:56:59 2014 +0200
a11y: unref selected item only if it is not NULL
https://bugzilla.gnome.org/show_bug.cgi?id=733610
gtk/a11y/gtknotebookpageaccessible.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/a11y/gtknotebookpageaccessible.c b/gtk/a11y/gtknotebookpageaccessible.c
index a5a2dad..0f57c73 100644
--- a/gtk/a11y/gtknotebookpageaccessible.c
+++ b/gtk/a11y/gtknotebookpageaccessible.c
@@ -152,9 +152,13 @@ gtk_notebook_page_accessible_ref_state_set (AtkObject *accessible)
atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
selected = atk_selection_ref_selection (ATK_SELECTION (page->priv->notebook), 0);
- if (selected == accessible)
- atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
- g_object_unref (selected);
+ if (selected)
+ {
+ if (selected == accessible)
+ atk_state_set_add_state (state_set, ATK_STATE_SELECTED);
+
+ g_object_unref (selected);
+ }
label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (accessible));
if (label)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]