From 8678a20cedcd6e930e65ebdd840e3c9836eded0f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 4 Apr 2011 15:45:07 +0100 Subject: [PATCH 4/5] invoke_object_method, dbus_g_method_return_error: handle sending failure I just made it fatal, since it's either programming error or OOM. --- dbus/dbus-gobject.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index f21208e..ab94957 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1869,7 +1869,9 @@ invoke_object_method (GObject *object, if (reply) { - dbus_connection_send (connection, reply, NULL); + if (!dbus_connection_send (connection, reply, NULL)) + g_error ("dbus_connection_send failed: out of memory?"); + dbus_message_unref (reply); } @@ -3026,7 +3028,10 @@ dbus_g_method_return_error (DBusGMethodInvocation *context, const GError *error) goto out; reply = gerror_to_dbus_error_message (context->object, dbus_g_message_get_message (context->message), error); - dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL); + if (!dbus_connection_send ( + dbus_g_connection_get_connection (context->connection), reply, NULL)) + g_error ("dbus_connection_send failed: out of memory?"); + dbus_message_unref (reply); out: -- 1.7.4.1