[gtk+/wip/a11y: 10/10] a11y: Implement get_name() instead of setting variables



commit 1a696408b26ca5a357f99cc648caf5e59f975b7e
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]