lib/gpg: Switch to GLib autocleanups for gpgme types

Prep for dropping `GLNX_DEFINE_CLEANUP_FUNCTION` from libglnx
in favor of using GLib's `G_DEFINE_AUTO_CLEANUP_FREE_FUNC()`.

Closes: #1042
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-08-02 16:55:38 +00:00
1 parent 6347c0fb88
commit ded6417aee
4 files changed
+9 -11

No files matched your search

+1 -1
View File
@@ -413,7 +413,7 @@ ot_gpgme_new_ctx (const char *homedir,
GError **error)
{
gpgme_error_t err;
ot_auto_gpgme_ctx gpgme_ctx_t context = NULL;
g_auto(gpgme_ctx_t) context = NULL;
if ((err = gpgme_new (&context)) != GPG_ERR_NO_ERROR)
{
+2 -4
View File
@@ -26,10 +26,8 @@
G_BEGIN_DECLS
GLNX_DEFINE_CLEANUP_FUNCTION0(gpgme_data_t, ot_cleanup_gpgme_data, gpgme_data_release)
#define ot_auto_gpgme_data __attribute__((cleanup(ot_cleanup_gpgme_data)))
GLNX_DEFINE_CLEANUP_FUNCTION0(gpgme_ctx_t, ot_cleanup_gpgme_ctx, gpgme_release)
#define ot_auto_gpgme_ctx __attribute__((cleanup(ot_cleanup_gpgme_ctx)))
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(gpgme_data_t, gpgme_data_release, NULL);
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(gpgme_ctx_t, gpgme_release, NULL);
void ot_gpgme_error_to_gio_error (gpgme_error_t gpg_error, GError **error);