From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 88D556DE0361 for ; Sat, 3 Jun 2017 10:48:13 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q1EUvMbYru2h for ; Sat, 3 Jun 2017 10:48:08 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 1D3706DE009B for ; Sat, 3 Jun 2017 10:48:08 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dHD8n-0002NP-Gv; Sat, 03 Jun 2017 13:47:09 -0400 Received: (nullmailer pid 17117 invoked by uid 1000); Sat, 03 Jun 2017 17:48:04 -0000 From: David Bremner To: notmuch@notmuchmail.org, notmuch@freelists.org Subject: [PATCH 21/23] lib: paper over allocation difference Date: Sat, 3 Jun 2017 14:47:52 -0300 Message-Id: <20170603174754.16911-22-david@tethera.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170603174754.16911-1-david@tethera.net> References: <20170603174754.16911-1-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 17:48:13 -0000 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