From 4ee1acd98109e98fd0a659f43d3187597d034f05 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 4 May 2015 18:22:39 -0400 Subject: Use g_autoptr() for GIO object types GLib 2.44 supplies all the necessary autocleanup macros for GIO types, and libglnx backports the relevant macros for ostree. --- src/libostree/ostree-sysroot-cleanup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libostree/ostree-sysroot-cleanup.c') diff --git a/src/libostree/ostree-sysroot-cleanup.c b/src/libostree/ostree-sysroot-cleanup.c index 02bbe567..46ad0e93 100644 --- a/src/libostree/ostree-sysroot-cleanup.c +++ b/src/libostree/ostree-sysroot-cleanup.c @@ -34,8 +34,8 @@ _ostree_sysroot_list_deployment_dirs_for_os (GFile *osdir, { gboolean ret = FALSE; const char *osname = gs_file_get_basename_cached (osdir); - gs_unref_object GFileEnumerator *dir_enum = NULL; - gs_unref_object GFile *osdeploy_dir = NULL; + g_autoptr(GFileEnumerator) dir_enum = NULL; + g_autoptr(GFile) osdeploy_dir = NULL; GError *temp_error = NULL; osdeploy_dir = g_file_get_child (osdir, "deploy"); @@ -97,8 +97,8 @@ list_all_deployment_directories (OstreeSysroot *self, GError **error) { gboolean ret = FALSE; - gs_unref_object GFileEnumerator *dir_enum = NULL; - gs_unref_object GFile *deploydir = NULL; + g_autoptr(GFileEnumerator) dir_enum = NULL; + g_autoptr(GFile) deploydir = NULL; gs_unref_ptrarray GPtrArray *ret_deployments = NULL; GError *temp_error = NULL; @@ -184,8 +184,8 @@ list_all_boot_directories (OstreeSysroot *self, GError **error) { gboolean ret = FALSE; - gs_unref_object GFileEnumerator *dir_enum = NULL; - gs_unref_object GFile *boot_ostree = NULL; + g_autoptr(GFileEnumerator) dir_enum = NULL; + g_autoptr(GFile) boot_ostree = NULL; gs_unref_ptrarray GPtrArray *ret_bootdirs = NULL; GError *temp_error = NULL; @@ -250,7 +250,7 @@ cleanup_other_bootversions (OstreeSysroot *self, gboolean ret = FALSE; int cleanup_bootversion; int cleanup_subbootversion; - gs_unref_object GFile *cleanup_boot_dir = NULL; + g_autoptr(GFile) cleanup_boot_dir = NULL; cleanup_bootversion = self->bootversion == 0 ? 1 : 0; cleanup_subbootversion = self->subbootversion == 0 ? 1 : 0; -- cgit v1.2.1