[Xfce4-commits] [xfce/xfconf] 26/31: Added copyright information + fix a couple of other memory leaks.
noreply at xfce.org
noreply at xfce.org
Thu Jun 1 13:33:19 CEST 2017
This is an automated email from the git hooks/post-receive script.
a l i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfconf.
commit d8149a18e28125c6c514043810bee6e8617ad85f
Author: Ali Abdallah <aliovx at gmail.com>
Date: Mon Apr 25 22:11:48 2016 +0200
Added copyright information + fix a couple of other memory leaks.
---
common/xfconf-gvaluefuncs.c | 11 +++++++++--
xfconfd/main.c | 1 +
xfconfd/xfconf-daemon.c | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/common/xfconf-gvaluefuncs.c b/common/xfconf-gvaluefuncs.c
index fd5059f..b20424c 100644
--- a/common/xfconf-gvaluefuncs.c
+++ b/common/xfconf-gvaluefuncs.c
@@ -1,6 +1,7 @@
/*
* xfconf
*
+ * Copyright (c) 2016 Ali Abdallah <ali at xfce.org>
* Copyright (c) 2008 Brian Tarricone <bjt23 at cornell.edu>
*
* This library is free software; you can redistribute it and/or
@@ -565,6 +566,12 @@ GVariant *xfconf_hash_to_gvariant (GHashTable *hash)
return variant;
}
+static void _destroy_array_elem (gpointer data) {
+ GValue *val = (GValue*)data;
+ g_value_unset (val);
+ g_free (val);
+}
+
GValue * xfconf_gvariant_to_gvalue (GVariant *in_variant)
{
GValue *value;
@@ -585,7 +592,7 @@ GValue * xfconf_gvariant_to_gvalue (GVariant *in_variant)
nchild = g_variant_n_children (variant);
if (nchild > 0) {
- arr = g_ptr_array_sized_new(nchild);
+ arr = g_ptr_array_new_full(nchild, (GDestroyNotify)_destroy_array_elem);
while (idx < nchild ) {
GVariant *v;
@@ -604,7 +611,7 @@ GValue * xfconf_gvariant_to_gvalue (GVariant *in_variant)
}
g_value_init(value, G_TYPE_PTR_ARRAY);
- g_value_set_boxed(value, arr);
+ g_value_take_boxed(value, arr);
}
}
else if (g_variant_is_of_type (variant, G_VARIANT_TYPE("as"))) {
diff --git a/xfconfd/main.c b/xfconfd/main.c
index ad02d9c..8a8fc2a 100644
--- a/xfconfd/main.c
+++ b/xfconfd/main.c
@@ -1,6 +1,7 @@
/*
* xfconf
*
+ * Copyright (c) 2016 Ali Abdallah <ali at xfce.org>
* Copyright (c) 2007 Brian Tarricone <bjt23 at cornell.edu>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/xfconfd/xfconf-daemon.c b/xfconfd/xfconf-daemon.c
index a729519..b96edfd 100644
--- a/xfconfd/xfconf-daemon.c
+++ b/xfconfd/xfconf-daemon.c
@@ -189,8 +189,9 @@ xfconf_set_property(XfconfExported *skeleton,
g_dbus_method_invocation_return_gerror(invocation, error);
g_error_free(error);
}
-
+
g_value_unset (value);
+ g_free (value);
return TRUE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list