[gtk+: 2/2] a11y: Implement get_name() instead of setting variables
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+: 2/2] a11y: Implement get_name() instead of setting variables
- Date: Sun, 13 Jan 2013 23:38:31 +0000 (UTC)
commit f260affbb89476ea18ff865aa774f8eeeae39f93
Author: Benjamin Otte <otte redhat com>
Date: Sun Jan 13 18:50:16 2013 +0100
a11y: Implement get_name() instead of setting variables
This avoids a later free of this const value.
gtk/a11y/gtktoplevelaccessible.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gtk/a11y/gtktoplevelaccessible.c b/gtk/a11y/gtktoplevelaccessible.c
index 14a2a19..56d5183 100644
--- a/gtk/a11y/gtktoplevelaccessible.c
+++ b/gtk/a11y/gtktoplevelaccessible.c
@@ -44,7 +44,6 @@ gtk_toplevel_accessible_initialize (AtkObject *accessible,
ATK_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_APPLICATION;
- accessible->name = g_get_prgname ();
accessible->accessible_parent = NULL;
}
@@ -87,6 +86,12 @@ gtk_toplevel_accessible_ref_child (AtkObject *obj,
return atk_obj;
}
+static const char *
+gtk_toplevel_accessible_get_name (AtkObject *obj)
+{
+ return g_get_prgname ();
+}
+
static gboolean
is_combo_window (GtkWidget *widget)
{
@@ -143,6 +148,7 @@ gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
class->get_n_children = gtk_toplevel_accessible_get_n_children;
class->ref_child = gtk_toplevel_accessible_ref_child;
class->get_parent = NULL;
+ class->get_name = gtk_toplevel_accessible_get_name;
g_object_class->finalize = gtk_toplevel_accessible_object_finalize;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]