summaryrefslogtreecommitdiff
path: root/tests/util.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-11-16 14:08:45 +0100
committerXavier Claessens <xclaesse@gmail.com>2011-11-16 14:36:51 +0100
commit67bffca0678d1286d07b1531f6562126e92cc31e (patch)
tree309fa93328b63d8c1a90432bc1c697b4a97beba0 /tests/util.c
parente6d8b4c7531688cd2dbd3c9bbd8a6c224123de05 (diff)
downloadtelepathy-glib-67bffca0678d1286d07b1531f6562126e92cc31e.tar.gz
Use _unref instead of _free _destroy when possible.
Replace g_(ptr_)array_free (foo, TRUE) and g_hash_table_destroy with respectively g_(ptr_)array_unref (foo) and g_hash_table_unref. I used this command to generate this patch: for f in `find -name "*.c"`; do sed -i $f -re 's/g_ptr_array_free \(([^ ,]+), TRUE\)/g_ptr_array_unref \(\1\)/'; done See Danielle's blog for explanation of possible bug _free can do: http://blogs.gnome.org/danni/2011/11/16/mistakes-with-g_value_set_boxed/
Diffstat (limited to 'tests/util.c')
-rw-r--r--tests/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/util.c b/tests/util.c
index 081a51b50..7c1d08689 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -301,7 +301,7 @@ int main (int argc, char **argv)
g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (23)));
g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (42)));
g_assert (!tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (666)));
- g_ptr_array_free (ptrarray, TRUE);
+ g_ptr_array_unref (ptrarray);
string = tp_escape_as_identifier ("");
g_assert (!tp_strdiff (string, "_"));