aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-05-20 09:05:22 -0300
committerDavid Bremner <david@tethera.net>2017-07-14 21:23:52 -0300
commit4ce7591610444a1c5ef6f56b57af8e180437fa62 (patch)
tree072fe6c7b6e5963ba0ff059d4024b3ece8a30704
parenteeb64cdeeb134bcd30c0927bde74dea8e9a7b88a (diff)
lib: paper over allocation difference
In gmime 3.0 this function is "transfer none", so no deallocation is needed (or permitted)
-rw-r--r--lib/index.cc2
-rw-r--r--notmuch-reply.c2
-rw-r--r--util/gmime-extra.h3
3 files changed, 5 insertions, 2 deletions
diff --git a/lib/index.cc b/lib/index.cc
index 044e4111..10420d84 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -501,7 +501,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/notmuch-reply.c b/notmuch-reply.c
index 4c1dd560..430c466c 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -286,7 +286,7 @@ static InternetAddressList *get_sender(GMimeMessage *message)
if (! reply_to_header_is_redundant (message, reply_to_list))
return reply_to_list;
- g_object_unref (G_OBJECT (reply_to_list));
+ g_mime_2_6_unref (G_OBJECT (reply_to_list));
}
return g_mime_message_get_from (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
/**