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, ¶ms, format, reply_all) != 0) > return EXIT_FAILURE; > > +#if (GMIME_MAJOR_VERSION < 3) > notmuch_crypto_cleanup (¶ms.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 (¶ms.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