[gtk+/gtk-3-16] a11y: Free the cell text after emitting text-changed:delete.



commit c7b96d85794cf5c7e8087d8f5b9157b65774bb8b
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Mar 25 04:00:20 2015 +0100

    a11y: Free the cell text after emitting text-changed:delete.
    
    This is needed because AT-SPI2's ATK bridge exposes the deleted string
    to ATs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746706

 gtk/a11y/gtktextcellaccessible.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c
index 8ea2d27..30a2121 100644
--- a/gtk/a11y/gtktextcellaccessible.c
+++ b/gtk/a11y/gtktextcellaccessible.c
@@ -136,7 +136,7 @@ gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell)
 {
   GtkTextCellAccessible *text_cell = GTK_TEXT_CELL_ACCESSIBLE (cell);
   AtkObject *obj = ATK_OBJECT (cell);
-  gint temp_length, text_length;
+  gint text_length;
   gchar *text;
   GtkCellRenderer *renderer;
 
@@ -156,15 +156,13 @@ gtk_text_cell_accessible_update_cache (GtkCellAccessible *cell)
     {
       if (text_cell->priv->cell_length)
         {
-          g_free (text_cell->priv->cell_text);
-          temp_length = text_cell->priv->cell_length;
-          text_cell->priv->cell_text = NULL;
-          text_cell->priv->cell_length = 0;
-          g_signal_emit_by_name (cell, "text-changed::delete", 0, temp_length);
+          g_signal_emit_by_name (cell, "text-changed::delete",
+                                 0, text_cell->priv->cell_length);
           if (obj->name == NULL)
             g_object_notify (G_OBJECT (obj), "accessible-name");
         }
 
+      g_free (text_cell->priv->cell_text);
       text_cell->priv->cell_text = g_strdup (text);
       text_cell->priv->cell_length = text_length;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]