tree-wide: Use g_autoptr(Ostree*)

Part of cleaning up our usage of libglnx; we want to use what's in GLib where we
can.

Had to change a few .c files to `#include ostree.h` early on to pick up
autoptrs for the core types.

Closes: #1040
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-08-03 13:48:12 +00:00
1 parent aa63d0e0c5
commit b929b620ae
47 files changed
+114 -110

No files matched your search

+4 -5
View File
@@ -22,9 +22,8 @@
#include "config.h"
#include "ostree-mutable-tree.h"
#include "ostree.h"
#include "otutil.h"
#include "ostree-core.h"
/**
* SECTION:ostree-mutable-tree
@@ -183,7 +182,7 @@ ostree_mutable_tree_ensure_dir (OstreeMutableTree *self,
GError **error)
{
gboolean ret = FALSE;
glnx_unref_object OstreeMutableTree *ret_dir = NULL;
g_autoptr(OstreeMutableTree) ret_dir = NULL;
g_return_val_if_fail (name != NULL, FALSE);
@@ -219,7 +218,7 @@ ostree_mutable_tree_lookup (OstreeMutableTree *self,
GError **error)
{
gboolean ret = FALSE;
glnx_unref_object OstreeMutableTree *ret_subdir = NULL;
g_autoptr(OstreeMutableTree) ret_subdir = NULL;
g_autofree char *ret_file_checksum = NULL;
ret_subdir = ot_gobject_refz (g_hash_table_lookup (self->subdirs, name));
@@ -261,7 +260,7 @@ ostree_mutable_tree_ensure_parent_dirs (OstreeMutableTree *self,
gboolean ret = FALSE;
int i;
OstreeMutableTree *subdir = self; /* nofree */
glnx_unref_object OstreeMutableTree *ret_parent = NULL;
g_autoptr(OstreeMutableTree) ret_parent = NULL;
g_assert (metadata_checksum != NULL);