[gobject-introspection] tests: Fix memory leak in gi_marshalling_tests_ghashtable_utf8_full_return
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Fix memory leak in gi_marshalling_tests_ghashtable_utf8_full_return
- Date: Mon, 4 Mar 2013 10:15:38 +0000 (UTC)
commit 513376b826fe027f8ae6c36e42566de2a73e4881
Author: Martin Pitt <martinpitt gnome org>
Date: Mon Mar 4 11:14:44 2013 +0100
tests: Fix memory leak in gi_marshalling_tests_ghashtable_utf8_full_return
For the "transfer full" case we need to supply free functions for the created
hash table in gi_marshalling_tests_ghashtable_utf8_full_return().
tests/gimarshallingtests.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c
index dc7fabd..f6fd630 100644
--- a/tests/gimarshallingtests.c
+++ b/tests/gimarshallingtests.c
@@ -2933,7 +2933,7 @@ gi_marshalling_tests_ghashtable_utf8_full_return (void)
{
GHashTable *hash_table = NULL;
- hash_table = g_hash_table_new (g_str_hash, g_str_equal);
+ hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
g_hash_table_insert (hash_table, g_strdup ("-1"), g_strdup ("1"));
g_hash_table_insert (hash_table, g_strdup ("0"), g_strdup ("0"));
g_hash_table_insert (hash_table, g_strdup ("1"), g_strdup ("-1"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]