summaryrefslogtreecommitdiff
path: root/gtk/a11y/gtknotebookaccessible.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-12-18 17:14:47 +0100
committerBenjamin Otte <otte@redhat.com>2011-12-19 16:17:13 +0100
commit7b5b678e2e69f2b7000a451f6a2ae3bab294d19a (patch)
treeca39e4a089d5e667c58992f3580d19a24640600f /gtk/a11y/gtknotebookaccessible.c
parente042462674156ae09e07bfd1afcaef54a75f6340 (diff)
downloadgtk+-7b5b678e2e69f2b7000a451f6a2ae3bab294d19a.tar.gz
a11y: Fix crash in notebook
When the accessible was disposed before the notebook it referenced, the weak ref could still trigger. This works around it.
Diffstat (limited to 'gtk/a11y/gtknotebookaccessible.c')
-rw-r--r--gtk/a11y/gtknotebookaccessible.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gtk/a11y/gtknotebookaccessible.c b/gtk/a11y/gtknotebookaccessible.c
index c4e5b26c94..96e9cfe591 100644
--- a/gtk/a11y/gtknotebookaccessible.c
+++ b/gtk/a11y/gtknotebookaccessible.c
@@ -42,6 +42,8 @@ check_focus_tab (gpointer data)
atk_obj = ATK_OBJECT (data);
accessible = GTK_NOTEBOOK_ACCESSIBLE (atk_obj);
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_obj));
+ if (widget == NULL)
+ return FALSE;
notebook = GTK_NOTEBOOK (widget);
accessible->idle_focus_id = 0;
@@ -133,17 +135,6 @@ page_removed_cb (GtkNotebook *notebook,
static void
-accessible_destroyed (gpointer data)
-{
- GtkNotebookAccessible *accessible = GTK_NOTEBOOK_ACCESSIBLE (data);
-
- if (accessible->idle_focus_id)
- {
- g_source_remove (accessible->idle_focus_id);
- accessible->idle_focus_id = 0;
- }
-}
-static void
gtk_notebook_accessible_initialize (AtkObject *obj,
gpointer data)
{
@@ -171,8 +162,6 @@ gtk_notebook_accessible_initialize (AtkObject *obj,
g_signal_connect (notebook, "page-removed",
G_CALLBACK (page_removed_cb), NULL);
- g_object_weak_ref (G_OBJECT (notebook), (GWeakNotify)accessible_destroyed, obj);
-
obj->role = ATK_ROLE_PAGE_TAB_LIST;
}