summaryrefslogtreecommitdiff
path: root/tests/scanner/regress.c
diff options
context:
space:
mode:
authorSimon Feltman <s.feltman@gmail.com>2016-12-23 15:15:31 -0800
committerPhilip Chimento <philip.chimento@gmail.com>2018-07-27 20:46:27 -0400
commited8579029430cb64e107f5bbc846f44da5d3a2ec (patch)
treecaa3341232ecd6f417676b59782974fa770c7237 /tests/scanner/regress.c
parent3670539091a02de93868af869923e54a276bb029 (diff)
downloadgobject-introspection-ed8579029430cb64e107f5bbc846f44da5d3a2ec.tar.gz
regress: Use g_list_free_full and g_list_copy_deep
Cleanup which replaces manual loop implementation with API calls when setting the linked list property. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
Diffstat (limited to 'tests/scanner/regress.c')
-rw-r--r--tests/scanner/regress.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index e1da3d17..3ab85644 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -2135,15 +2135,9 @@ regress_test_obj_set_property (GObject *object,
case PROP_TEST_OBJ_LIST:
case PROP_TEST_OBJ_LIST_OLD:
- if (self->list != NULL)
- {
- for (list = self->list; list != NULL; list = g_list_next (list))
- g_free (list->data);
- g_list_free (self->list);
- }
- self->list = NULL;
- for (list = g_value_get_pointer (value); list != NULL; list = g_list_next (list))
- self->list = g_list_append (self->list, g_strdup (list->data));
+ g_list_free_full (self->list, g_free);
+ list = g_value_get_pointer (value);
+ self->list = g_list_copy_deep (list, (GCopyFunc) g_strdup, NULL);
break;
case PROP_TEST_OBJ_INT: