X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=blobdiff_plain;f=atk-adaptor%2Fevent.c;h=2253ec0fa6b12f9d354766051a4f6cb3a3c63be1;hp=9e6e83e1fb5e763d3985f7d45b8b5977cfac841f;hb=bf2e5788c56e02322e8e4b80a9be16301ffd1a49;hpb=0bfdafe643cb89584a315a18435558b5e4c4c37f diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c index 9e6e83e..2253ec0 100644 --- a/atk-adaptor/event.c +++ b/atk-adaptor/event.c @@ -23,6 +23,7 @@ */ #include +#include #include #include @@ -31,6 +32,9 @@ #include "accessible-register.h" #include "common/spi-dbus.h" +#include "event.h" +#include "object.h" +#include "dbus/dbus-glib-lowlevel.h" static GArray *listener_ids = NULL; @@ -55,15 +59,16 @@ typedef struct _SpiReentrantCallClosure static void switch_main_context (GMainContext *cnx) { -#ifndef DISABLE_P2P /* This code won't work on dbus-glib earlier than 0.9.0 because of FDO#30574 */ + if (spi_global_app_data->app_bus_addr [0] == '\0') + return; + GList *list; dbus_server_setup_with_g_main (spi_global_app_data->server, cnx); dbus_connection_setup_with_g_main (spi_global_app_data->bus, cnx); for (list = spi_global_app_data->direct_connections; list; list = list->next) dbus_connection_setup_with_g_main (list->data, cnx); -#endif } static void @@ -72,6 +77,7 @@ set_reply (DBusPendingCall * pending, void *user_data) SpiReentrantCallClosure* closure = (SpiReentrantCallClosure *) user_data; closure->reply = dbus_pending_call_steal_reply (pending); + dbus_pending_call_unref (pending); switch_main_context (NULL); g_main_loop_quit (closure->loop); } @@ -88,7 +94,7 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message) closure.loop = g_main_loop_new (main_context, FALSE); switch_main_context (main_context); - if (!dbus_connection_send_with_reply (bus, message, &pending, -1)) + if (!dbus_connection_send_with_reply (bus, message, &pending, -1) || !pending) { switch_main_context (NULL); return NULL; @@ -395,8 +401,7 @@ emit_event (AtkObject *obj, void (*append_variant) (DBusMessageIter *, const char *, const void *)) { DBusConnection *bus = spi_global_app_data->bus; - const char *path = spi_register_object_to_path (spi_global_register, - G_OBJECT (obj)); + const char *path; gchar *cname, *t; DBusMessage *sig; @@ -410,6 +415,8 @@ emit_event (AtkObject *obj, if (!signal_is_needed (klass, major, minor)) return; + path = spi_register_object_to_path (spi_global_register, G_OBJECT (obj)); + /* * This is very annoying, but as '-' isn't a legal signal * name in D-Bus (Why not??!?) The names need converting @@ -433,6 +440,7 @@ emit_event (AtkObject *obj, spi_object_lease_if_needed (G_OBJECT (obj)); g_free(cname); + g_free (path); } /*---------------------------------------------------------------------------*/