2008-08-18 Mark Doffman <mark.doffman@codethink.co.uk>
authorMark Doffman <mdoff@silver-wind.(none)>
Mon, 18 Aug 2008 13:58:27 +0000 (14:58 +0100)
committerMark Doffman <mdoff@silver-wind.(none)>
Mon, 18 Aug 2008 13:58:27 +0000 (14:58 +0100)
* atk-adaptor/accessible.c
Fix bug in impl_getState that causes a SIGSEGV.

* atk-adaptor/tree.c
Modification to check if parent exists before
attempting to add to cache.

atk-adaptor/accessible.c
atk-adaptor/tree.c

index 96dd24d..d7970fe 100644 (file)
@@ -466,6 +466,7 @@ impl_getState (DBusConnection * bus, DBusMessage * message, void *user_data)
 {
   AtkObject *object = get_object (message);
   dbus_uint32_t rv[2];
+  dbus_uint32_t *array = rv;
   DBusMessage *reply;
 
   if (!object)
@@ -474,7 +475,7 @@ impl_getState (DBusConnection * bus, DBusMessage * message, void *user_data)
   reply = dbus_message_new_method_return (message);
   if (reply)
     {
-      dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &rv,
+      dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &array,
                                2, DBUS_TYPE_INVALID);
     }
   return reply;
index 01b53a4..64258ba 100644 (file)
@@ -39,18 +39,27 @@ append_update (DBusMessageIter * iter_array, AtkObject * obj,
   const char *name, *desc;
   int i;
   dbus_uint32_t role;
+  AtkObject *parent = NULL;
 
   gint childcount;
   GSList *l;
 
   g_assert(data != NULL);
 
+  parent = atk_object_get_parent(obj);
+  if (parent == NULL)
+    {
+      path_parent = g_strdup("/");
+    }
+  else
+    {
+      path_parent = spi_dbus_get_path (parent);
+    }
+
   dbus_message_iter_open_container (iter_array, DBUS_TYPE_STRUCT, NULL,
                                    &iter_struct);
   path = spi_dbus_get_path (obj);
   dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &path);
-  path_parent = spi_dbus_get_path (atk_object_get_parent(obj));
-  if (!path_parent) path_parent = g_strdup("/");
   dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_OBJECT_PATH, &path_parent);
   g_free(path_parent);
   dbus_message_iter_open_container (&iter_struct, DBUS_TYPE_ARRAY, "o",