Use gsystem GKeyFile cleanups

This is now in 2014.3.
This commit is contained in:
Colin Walters 2015-01-06 09:28:29 -05:00
parent 8e7c75968d
commit 22ac2dfd1f
3 changed files with 3 additions and 15 deletions

View File

@ -61,8 +61,8 @@ rpmostree_builtin_rebase (int argc,
gboolean changed;
GSConsole *console = NULL;
gboolean in_status_line = FALSE;
_cleanup_gkeyfile_ GKeyFile *old_origin = NULL;
_cleanup_gkeyfile_ GKeyFile *new_origin = NULL;
gs_unref_keyfile GKeyFile *old_origin = NULL;
gs_unref_keyfile GKeyFile *new_origin = NULL;
if (!rpmostree_option_context_parse (context, option_entries, &argc, &argv, error))
goto out;

View File

@ -35,10 +35,6 @@
#include "libgsystem.h"
/* This one is in libgsystem git master, but not 2014.2 */
GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, _cleanup_g_key_file_unref, g_key_file_unref);
#define _cleanup_gkeyfile_ __attribute__((cleanup(_cleanup_g_key_file_unref)))
GS_DEFINE_CLEANUP_FUNCTION0(HySack, _cleanup_hy_sack_free, hy_sack_free);
GS_DEFINE_CLEANUP_FUNCTION0(HyQuery, _cleanup_hy_query_free, hy_query_free);
GS_DEFINE_CLEANUP_FUNCTION0(HyPackageList, _cleanup_hy_packagelist_free, hy_packagelist_free);

View File

@ -132,14 +132,6 @@ yum_context_free (YumContext *yumctx)
g_free (yumctx);
}
static inline
void cleanup_keyfile_unref (void *loc)
{
GKeyFile *locp = *((GKeyFile**)loc);
if (locp)
g_key_file_unref (locp);
}
static gboolean
append_repo_and_cache_opts (RpmOstreeTreeComposeContext *self,
JsonObject *treedata,
@ -202,7 +194,7 @@ append_repo_and_cache_opts (RpmOstreeTreeComposeContext *self,
gs_free char *baseurl = g_strconcat ("file://", repodir, NULL);
gs_free char *tmprepo_filename = g_strconcat (reponame, ".repo", NULL);
gs_unref_object GFile *tmprepo_path = g_file_get_child (repos_tmpdir, tmprepo_filename);
__attribute__ ((cleanup(cleanup_keyfile_unref))) GKeyFile *keyfile = NULL;
gs_unref_keyfile GKeyFile *keyfile = NULL;
gs_free char *data = NULL;
gsize len;