repo/private: move OstreeRepoAutoTransaction to a boxed type

This defines `OstreeRepoAutoTransaction` as a boxed type, in order
to support auto-generating bindings for it.
That first requires adding internal reference-counting to it, to
allow freely copying/freeing references to a single transaction guard.
This commit is contained in:
Luca BRUNO committed 2021-10-11 06:52:25 +00:00
1 parent f4a3837662
commit 8a9737aa6e
2 files changed
+52 -17

No files matched your search

+9 -3
View File
@@ -525,6 +525,7 @@ _ostree_repo_verify_bindings (const char *collection_id,
*/
typedef struct
{
gint atomic_refcount;
OstreeRepo *repo;
} OstreeRepoAutoTransaction;
@@ -544,9 +545,14 @@ _ostree_repo_auto_transaction_commit (OstreeRepoAutoTransaction *txn,
GCancellable *cancellable,
GError **error);
void
_ostree_repo_auto_transaction_cleanup (void *p);
OstreeRepoAutoTransaction *
_ostree_repo_auto_transaction_ref (OstreeRepoAutoTransaction *txn);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoAutoTransaction, _ostree_repo_auto_transaction_cleanup);
void
_ostree_repo_auto_transaction_unref (OstreeRepoAutoTransaction *txn);
GType _ostree_repo_auto_transaction_get_type (void);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoAutoTransaction, _ostree_repo_auto_transaction_unref);
G_END_DECLS