lib: paper over allocation difference
authorDavid Bremner <david@tethera.net>
Sat, 20 May 2017 12:05:22 +0000 (09:05 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 15 Jul 2017 00:23:52 +0000 (21:23 -0300)
In gmime 3.0 this function is "transfer none", so no deallocation is
needed (or permitted)

lib/index.cc
notmuch-reply.c
util/gmime-extra.h

index 044e4111dc0b1420139fe0da429c34421891dd1f..10420d84426ca165659cba5118def218d6020cc3 100644 (file)
@@ -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);
     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);
     }
 
     addresses = g_mime_message_get_all_recipients (mime_message);
index 4c1dd56024698041f1c97bca50347ffca8cace2e..430c466c013e2cf511b6ce9fc8f201e4a93b81f9 100644 (file)
@@ -286,7 +286,7 @@ static InternetAddressList *get_sender(GMimeMessage *message)
        if (! reply_to_header_is_redundant (message, reply_to_list))
            return reply_to_list;
 
        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);
     }
 
     return g_mime_message_get_from (message);
index d744c4e4cb364b99734217e0f1aada597b12d36a..7688129a8cf9d52f5c58120d9b33b803c218ecd6 100644 (file)
@@ -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 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;
 
 #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 GMIME_CERTIFICATE_TRUST_FULLY GMIME_TRUST_FULL
 #define GMIME_CERTIFICATE_TRUST_ULTIMATE GMIME_TRUST_ULTIMATE
 
+#define g_mime_2_6_unref(obj) /*ignore*/
 #endif
 
 /**
 #endif
 
 /**