summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-06 14:08:44 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-06 14:08:44 -0400
commit67144c4fdc8362e6c1b2550301cc235b596d6e44 (patch)
tree5feea553e1d61bec63c3414917c7357f06dc6401 /gdbus
parentb54ca7b473dc9d2a8fe230342a71f55e9de1fde2 (diff)
downloaddconf-67144c4fdc8362e6c1b2550301cc235b596d6e44.tar.gz
GDBus backends: sink parameters, even on failure
The GDBus backends were not sinking the parameters for method calls on failure to acquire the bus.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/dconf-gdbus-filter.c11
-rw-r--r--gdbus/dconf-gdbus-thread.c4
2 files changed, 12 insertions, 3 deletions
diff --git a/gdbus/dconf-gdbus-filter.c b/gdbus/dconf-gdbus-filter.c
index 09ff43d..8e8f42b 100644
--- a/gdbus/dconf-gdbus-filter.c
+++ b/gdbus/dconf-gdbus-filter.c
@@ -217,7 +217,10 @@ dconf_engine_dbus_call_async_func (GBusType bus_type,
state = dconf_gdbus_get_connection_state (bus_type, error);
if (state == NULL)
- return FALSE;
+ {
+ g_variant_unref (g_variant_ref_sink (parameters));
+ return FALSE;
+ }
message = g_dbus_message_new_method_call (bus_name, object_path, interface_name, method_name);
g_dbus_message_set_body (message, parameters);
@@ -286,7 +289,11 @@ dconf_engine_dbus_call_sync_func (GBusType bus_type,
state = dconf_gdbus_get_connection_state (bus_type, error);
if (state == NULL)
- return NULL;
+ {
+ g_variant_unref (g_variant_ref_sink (parameters));
+
+ return NULL;
+ }
return g_dbus_connection_call_sync (connection_state_get_connection (state),
bus_name, object_path, interface_name, method_name, parameters, reply_type,
diff --git a/gdbus/dconf-gdbus-thread.c b/gdbus/dconf-gdbus-thread.c
index 14183d0..3c868b5 100644
--- a/gdbus/dconf-gdbus-thread.c
+++ b/gdbus/dconf-gdbus-thread.c
@@ -273,7 +273,7 @@ dconf_engine_dbus_call_async_func (GBusType bus_type,
call->object_path = object_path;
call->interface_name = interface_name;
call->method_name = method_name;
- call->parameters = g_variant_ref (parameters);
+ call->parameters = g_variant_ref_sink (parameters);
call->handle = handle;
g_main_context_invoke (dconf_gdbus_get_worker_context (), dconf_gdbus_method_call, call);
@@ -336,6 +336,8 @@ dconf_engine_dbus_call_sync_func (GBusType bus_type,
if (connection == NULL)
{
+ g_variant_unref (g_variant_ref_sink (parameters));
+
if (error)
*error = g_error_copy (inner_error);