summaryrefslogtreecommitdiff
path: root/src/gdbusxx/gdbus-cxx-bridge.h
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-01-16 17:02:23 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2012-01-17 11:04:37 +0100
commite4d6c154adb40cfd482f474caf5c9800ab776c4a (patch)
tree6f92b284a174b061ce854e2e967446dc60c15957 /src/gdbusxx/gdbus-cxx-bridge.h
parentee9c9cff448fdf38c116f4ba1336d8400f7a90d2 (diff)
GDBus GIO: fixed asynchronous message replies
First, asynchronous method replies were not detected because their dbus_traits still had "asynchronous = false". Second, the NULL reply from an asynchrounous implementation was passed to g_dbus_connection_send_message(), causing an error message to be logged.
Diffstat (limited to 'src/gdbusxx/gdbus-cxx-bridge.h')
-rw-r--r--src/gdbusxx/gdbus-cxx-bridge.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gdbusxx/gdbus-cxx-bridge.h b/src/gdbusxx/gdbus-cxx-bridge.h
index 2e82f787..a759e50e 100644
--- a/src/gdbusxx/gdbus-cxx-bridge.h
+++ b/src/gdbusxx/gdbus-cxx-bridge.h
@@ -844,6 +844,12 @@ struct MethodHandler
g_dbus_method_invocation_get_message(invocation),
methodData);
+ if (!reply) {
+ // probably asynchronous, might also be out-of-memory;
+ // either way, don't send a reply now
+ return;
+ }
+
GError *error = NULL;
g_dbus_connection_send_message(g_dbus_method_invocation_get_connection(invocation),
reply,
@@ -2243,7 +2249,7 @@ template <class R, class DBusR> struct dbus_traits_result
typedef boost::shared_ptr<R> host_type;
typedef boost::shared_ptr<R> &arg_type;
- static const bool asynchronous = false;
+ static const bool asynchronous = true;
static void get(GDBusConnection *conn, GDBusMessage *msg,
GVariantIter &iter, host_type &value)