[gnome-settings-daemon/gnome-3-2] power: Fix two small reference leaks when using the D-Bus interface
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-2] power: Fix two small reference leaks when using the D-Bus interface
- Date: Mon, 26 Sep 2011 16:30:48 +0000 (UTC)
commit f24306a2fa496b6f6f2e7c00173834030882d7d5
Author: Richard Hughes <richard hughsie com>
Date: Mon Sep 26 10:06:13 2011 +0100
power: Fix two small reference leaks when using the D-Bus interface
Resolves: https://bugzilla.gnome.org/show_bug.cgi?id=660079
plugins/power/gsd-power-manager.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index f118642..d786977 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3726,6 +3726,7 @@ handle_method_call_main (GsdPowerManager *manager,
value = device_to_variant_blob (device);
tuple = g_variant_new_tuple (&value, 1);
g_dbus_method_invocation_return_value (invocation, tuple);
+ g_object_unref (device);
return;
}
@@ -3736,7 +3737,7 @@ handle_method_call_main (GsdPowerManager *manager,
builder = g_variant_builder_new (G_VARIANT_TYPE("a(susdut)"));
/* add each tuple to the array */
- array = g_ptr_array_ref (manager->priv->devices_array);
+ array = manager->priv->devices_array;
for (i=0; i<array->len; i++) {
device = g_ptr_array_index (array, i);
value = device_to_variant_blob (device);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]