From: Mike Gorse Date: Thu, 5 Sep 2013 03:29:15 +0000 (-0500) Subject: Properly clean up when timing out on a keystroke listener X-Git-Tag: AT_SPI2_ATK_2_12_0~23 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git;a=commitdiff_plain;h=548478747b2493842b736b4a1e2bc6bb3015f790 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 --- 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; }