build: Allow ostree to use g_autoptr on its types internally

As an example, I g_autoptred one OstreeRepo in the "ostree init"
command.

Closes: #295
Approved by: cgwalters
This commit is contained in:
Krzesimir Nowak authored and Atomic Bot committed 2016-05-17 21:13:20 +00:00
1 parent 24e3ccb780
commit d5f6104335
3 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -30,7 +30,10 @@ G_BEGIN_DECLS
#define OSTREE_WITH_AUTOCLEANUPS 0
#endif
#if OSTREE_WITH_AUTOCLEANUPS && GLIB_CHECK_VERSION(2, 44, 0)
/* ostree can use g_autoptr backports from libglnx when glib is too
* old, but still avoid exposing them to users that also have an old
* glib */
#if defined(OSTREE_COMPILATION) || (OSTREE_WITH_AUTOCLEANUPS && GLIB_CHECK_VERSION(2, 44, 0))
/*
* The following types have no specific clear/free/unref functions, so
+1 -1
View File
@@ -37,7 +37,7 @@ gboolean
ostree_builtin_init (int argc, char **argv, GCancellable *cancellable, GError **error)
{
GOptionContext *context = NULL;
glnx_unref_object OstreeRepo *repo = NULL;
g_autoptr(OstreeRepo) repo = NULL;
gboolean ret = FALSE;
OstreeRepoMode mode;