core: Drop ot_clear_hashtable for g_clear_pointer()

This commit is contained in:
Colin Walters 2012-07-17 08:18:43 -04:00
parent 43a2fec6a8
commit 0d86702115
3 changed files with 2 additions and 8 deletions

View File

@ -27,12 +27,6 @@
G_BEGIN_DECLS
#define ot_clear_hashtable(a_v) do { \
if (*a_v) \
g_hash_table_unref (*a_v); \
*a_v = NULL; \
} while (0);
GVariant *ot_gvariant_new_bytearray (const guchar *data,
gsize len);

View File

@ -1660,7 +1660,7 @@ ostree_builtin_pull (int argc, char **argv, GFile *repo_path, GError **error)
g_free (pull_data->remote_name);
if (pull_data->base_uri)
soup_uri_free (pull_data->base_uri);
ot_clear_hashtable (&pull_data->file_checksums_to_fetch);
g_clear_pointer (&pull_data->file_checksums_to_fetch, (GDestroyNotify) g_hash_table_unref);
g_clear_pointer (&pull_data->cached_meta_pack_indexes, (GDestroyNotify) g_ptr_array_unref);
g_clear_pointer (&pull_data->cached_data_pack_indexes, (GDestroyNotify) g_ptr_array_unref);
if (summary_uri)

View File

@ -347,7 +347,7 @@ ostree_builtin_fsck (int argc, char **argv, GFile *repo_path, GError **error)
g_hash_table_insert (commits, g_variant_ref (serialized_key), serialized_key);
}
ot_clear_hashtable (&objects);
g_clear_pointer (&objects, (GDestroyNotify) g_hash_table_unref);
g_print ("Verifying content integrity of %u commit objects...\n",
(guint)g_hash_table_size (commits));