[PATCH 21/23] lib: paper over allocation difference

David Bremner david at tethera.net
Sat Jun 3 10:47:52 PDT 2017


In gmime 3.0 this function is "transfer none", so no deallocation is
needed (or permitted)
---
 lib/index.cc       | 2 +-
 util/gmime-extra.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/index.cc b/lib/index.cc
index d2472896..70607069 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -450,7 +450,7 @@ _notmuch_message_index_file (notmuch_message_t *message,
     addresses = g_mime_message_get_from (mime_message);
     if (addresses) {
 	_index_address_list (message, "from", addresses);
-	g_object_unref (addresses);
+	g_mime_2_6_unref (addresses);
     }
 
     addresses = g_mime_message_get_all_recipients (mime_message);
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index d744c4e4..7688129a 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -13,6 +13,8 @@ GMimeStream *g_mime_stream_stdout_new(void);
 #define GMIME_ADDRESS_TYPE_CC GMIME_RECIPIENT_TYPE_CC
 #define GMIME_ADDRESS_TYPE_BCC GMIME_RECIPIENT_TYPE_BCC
 
+#define g_mime_2_6_unref(obj) g_object_unref (obj)
+
 #else /* GMime >= 3.0 */
 typedef GMimeAddressType GMimeRecipientType;
 
@@ -51,6 +53,7 @@ typedef GMimeTrust GMimeCertificateTrust;
 #define GMIME_CERTIFICATE_TRUST_FULLY GMIME_TRUST_FULL
 #define GMIME_CERTIFICATE_TRUST_ULTIMATE GMIME_TRUST_ULTIMATE
 
+#define g_mime_2_6_unref(obj) /*ignore*/
 #endif
 
 /**
-- 
2.11.0



More information about the notmuch mailing list