[balsa/gmime3: 44/49] Do not unref GDateTime



commit fe324ccd0111fe2645caf2e27ff9b15757166e2e
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Nov 25 18:32:54 2019 -0500

    Do not unref GDateTime
    
    returned by g_mime_message_get_date(); we do not own the ref.

 libbalsa/body.c    | 4 +---
 libbalsa/message.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libbalsa/body.c b/libbalsa/body.c
index 4d46c76b9..7d4b752e0 100644
--- a/libbalsa/body.c
+++ b/libbalsa/body.c
@@ -118,10 +118,8 @@ libbalsa_message_body_extract_embedded_headers(GMimeMessage* msg)
        ehdr->subject = g_strdup(_("(No subject)"));
 
     datetime = g_mime_message_get_date(msg);
-    if (datetime != NULL) {
+    if (datetime != NULL)
         ehdr->date = g_date_time_to_unix(datetime);
-        g_date_time_unref(datetime);
-    }
 
     return ehdr;
 }
diff --git a/libbalsa/message.c b/libbalsa/message.c
index 4bdb7ecdb..2d3e9b1b5 100644
--- a/libbalsa/message.c
+++ b/libbalsa/message.c
@@ -999,10 +999,8 @@ lb_message_headers_basic_from_gmime(LibBalsaMessageHeaders *headers,
         GDateTime *datetime;
 
         datetime = g_mime_message_get_date(mime_msg);
-        if (datetime != NULL) {
+        if (datetime != NULL)
             headers->date = g_date_time_to_unix(datetime);
-            g_date_time_unref(datetime);
-        }
     }
 
     if (headers->to_list == NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]