[PATCH 3/4] crypto: Avoid explicit handling of GMimeCryptoContext in gmime 3

Daniel Kahn Gillmor dkg at fifthhorseman.net
Sat Jul 15 15:45:27 PDT 2017


Thanks for trying to talk me down from my ifdefery, Bremner :)

I think this subseries looks reasonable, though:

On Sat 2017-07-15 15:57:43 -0300, David Bremner wrote:
> diff --git a/notmuch-reply.c b/notmuch-reply.c
> index 40201b80..4df29b82 100644
> --- a/notmuch-reply.c
> +++ b/notmuch-reply.c
> @@ -759,7 +759,9 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
>      if (do_reply (config, query, &params, format, reply_all) != 0)
>  	return EXIT_FAILURE;
>  
> +#if (GMIME_MAJOR_VERSION < 3)
>      notmuch_crypto_cleanup (&params.crypto);
> +#endif
>      notmuch_query_destroy (query);
>      notmuch_database_destroy (notmuch);
>  
> diff --git a/notmuch-show.c b/notmuch-show.c
> index 74e77249..4feba07b 100644
> --- a/notmuch-show.c
> +++ b/notmuch-show.c
> @@ -1241,7 +1241,9 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
>      g_mime_stream_flush (params.out_stream);
>      g_object_unref (params.out_stream);
>  
> +#if (GMIME_MAJOR_VERSION < 3)
>      notmuch_crypto_cleanup (&params.crypto);
> +#endif
>      notmuch_query_destroy (query);
>      notmuch_database_destroy (notmuch);

If you prefer to reduce #ifdefery, we can also just make
notmuch_crypto_cleanup a no-op in gmime 3.0, right?  that might be
simpler (because maybe something happens in notmuch_crypto that we do
ultimately want to clean up later anyway?)

      --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20170716/80754165/attachment.sig>


More information about the notmuch mailing list