Use g_free as element_free_func
authorSebastian Pölsterl <sebp@k-d-w.org>
Sun, 5 Feb 2012 10:41:12 +0000 (11:41 +0100)
committerSebastian Pölsterl <sebp@k-d-w.org>
Sun, 5 Feb 2012 10:41:12 +0000 (11:41 +0100)
The elements of the GPtrArray are of type char*, therefore use
g_free rather than g_object_unref to as element_free_func

tests/scanner/regress.c

index 3b0fc50222fdd69836432fd09b42f54ffe9f4aa6..8fd210e87f703d6e73a620030c1301612f68a600 100644 (file)
@@ -1327,7 +1327,7 @@ regress_test_garray_container_return (void)
 {
   GPtrArray *array;
 
-  array = g_ptr_array_new_with_free_func (g_object_unref);
+  array = g_ptr_array_new_with_free_func (g_free);
   g_ptr_array_add (array, g_strdup ("regress"));
 
   return array;