summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2013-09-04 22:29:15 -0500
committerMike Gorse <mgorse@suse.com>2013-09-04 22:29:15 -0500
commit548478747b2493842b736b4a1e2bc6bb3015f790 (patch)
treeb1de3c3328371ebc4531d9c4478a7126f2ea4958
parent402ab17c56930441d2a83b8dde3d5b5d1d4615fd (diff)
downloadat-spi2-atk-548478747b2493842b736b4a1e2bc6bb3015f790.tar.gz
Properly clean up when timing out on a keystroke listener
If we time out waiting for a keystroke listener, then exit the main loop, and reset the DBus connections' main loop contexts becak to the default loop. https://bugzilla.gnome.org/show_big.cgi?id=707218
-rw-r--r--atk-adaptor/event.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 8e8dd89..d8a74cc 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -88,8 +88,8 @@ timeout_reply (void *data)
{
SpiReentrantCallClosure *closure = data;
- if (!dbus_connection_get_is_connected (closure->bus))
- g_main_loop_quit (closure->loop);
+ switch_main_context (NULL);
+ g_main_loop_quit (closure->loop);
closure->timeout = -1;
return FALSE;
}
@@ -121,6 +121,8 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
g_source_destroy (source);
g_main_loop_unref (closure.loop);
+ if (!closure.reply)
+ dbus_pending_call_cancel (pending);
return closure.reply;
}