[at-spi2-core] Fix storing and freeing of hyperlink paths



commit e19d5c61d12104d0f7c94a8280096a5d637d53f9
Author: Mike Gorse <mgorse novell com>
Date:   Sat Jan 1 06:41:10 2011 -0500

    Fix storing and freeing of hyperlink paths

 atspi/atspi-misc.c   |    2 +-
 atspi/atspi-object.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 8dca97c..dd014a8 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -254,7 +254,7 @@ ref_hyperlink (const char *app_name, const char *path)
   hyperlink = atspi_hyperlink_new (app, path);
   if (!hyperlink)
     return NULL;
-  g_hash_table_insert (app->hash, hyperlink->parent.path, hyperlink);
+  g_hash_table_insert (app->hash, g_strdup (hyperlink->parent.path), hyperlink);
   /* TODO: This should be a weak ref */
   g_object_ref (hyperlink);	/* for the hash */
   return hyperlink;
diff --git a/atspi/atspi-object.c b/atspi/atspi-object.c
index 21a0ce1..3545845 100644
--- a/atspi/atspi-object.c
+++ b/atspi/atspi-object.c
@@ -49,8 +49,7 @@ atspi_object_finalize (GObject *object)
 {
   AtspiObject *aobj = ATSPI_OBJECT (object);
 
-  /* TODO: Figure out why the next line sometimes crashes */
-  /*g_free (aobj->path); */
+  g_free (aobj->path);
 
   G_OBJECT_CLASS (atspi_object_parent_class)->finalize (object);
 }



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