summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2008-08-30 08:53:46 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2008-08-30 08:53:46 +0800
commit7e095605e42a5a614fcfb1c0d34bebcb40222ec6 (patch)
treebc59b3c91a9f3579a86e5034fa6172796dcb2e12
parent7eac7f7367a926c24461a6185d70b744c764aaa2 (diff)
downloadibus-7e095605e42a5a614fcfb1c0d34bebcb40222ec6.tar.gz
ibus-7e095605e42a5a614fcfb1c0d34bebcb40222ec6.tar.xz
ibus-7e095605e42a5a614fcfb1c0d34bebcb40222ec6.zip
Fix segfault when connection is broken.
-rw-r--r--lib/gtk2/ibusimclient.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gtk2/ibusimclient.c b/lib/gtk2/ibusimclient.c
index 1287aa5..05975bf 100644
--- a/lib/gtk2/ibusimclient.c
+++ b/lib/gtk2/ibusimclient.c
@@ -1208,7 +1208,7 @@ _dbus_call_with_reply_valist (DBusConnection *connection,
}
if (!dbus_message_append_args_valist (message, first_arg_type, args)) {
- g_warning ("Can not create call message");
+ g_warning ("Can not create call message!");
goto error;
}
@@ -1218,6 +1218,15 @@ _dbus_call_with_reply_valist (DBusConnection *connection,
goto error;
}
+ /* If we got a NULL pending, that means the connection was disconnected,
+ * and we need to aboout this call
+ * https://bugs.freedesktop.org/show_bug.cgi?id=12675
+ */
+ if (pendingcall == 0) {
+ g_warning ("Connection is breaken!");
+ goto error;
+ }
+
if (!dbus_pending_call_set_notify (pendingcall, notify_function,
user_data, free_function)) {
g_warning ("Out of memory!");