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



commit 5192c9799a3ead446ae2321c76f77ca677ed4756
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 014aac7bb..d1c4407d7 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 b9c32cc17..9403b6877 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]