diff options
author | Daiki Ueno <dueno@src.gnome.org> | 2014-09-11 17:00:55 +0900 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2014-09-11 11:48:50 -0500 |
commit | 54d3b53515eb2ddbef32ad12446bd8c9fd731c3f (patch) | |
tree | 4ab75437f2c8503036b154bbf04c2f4621652180 | |
parent | af1bd0dc5e47f4f3361747011d44ed6429724918 (diff) | |
download | at-spi2-core-54d3b53515eb2ddbef32ad12446bd8c9fd731c3f.tar.gz |
Check failure of dbus_connection_send_with_reply()
-rw-r--r-- | atspi/atspi-misc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index f698544a..4c35df88 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -215,9 +215,11 @@ handle_get_bus_address (DBusPendingCall *pending, void *user_data) "/org/a11y/atspi/cache", atspi_interface_cache, "GetItems"); - dbus_connection_send_with_reply (app->bus, message, &new_pending, 2000); - dbus_pending_call_set_notify (new_pending, handle_get_items, app, NULL); + dbus_connection_send_with_reply (app->bus, message, &new_pending, 2000); dbus_message_unref (message); + if (!new_pending) + return; + dbus_pending_call_set_notify (new_pending, handle_get_items, app, NULL); } static AtspiApplication * @@ -247,9 +249,14 @@ get_application (const char *bus_name) message = dbus_message_new_method_call (bus_name, atspi_path_root, atspi_interface_application, "GetApplicationBusAddress"); - dbus_connection_send_with_reply (app->bus, message, &pending, 2000); - dbus_pending_call_set_notify (pending, handle_get_bus_address, app, NULL); + dbus_connection_send_with_reply (app->bus, message, &pending, 2000); dbus_message_unref (message); + if (!pending) + { + g_hash_table_remove (app_hash, bus_name_dup); + return NULL; + } + dbus_pending_call_set_notify (pending, handle_get_bus_address, app, NULL); return app; } |