Closed Icekettle closed 6 months ago
FYI, I'm using the latest version 3.2.14.
I'm confused as to what g_mime_utils_header_decode_text() has to do with your m_gMessage
? I guess I'm missing context.
I'm confused as to what g_mime_utils_header_decode_text() has to do with your
m_gMessage
? I guess I'm missing context.
Yeah, I 'm confused too. I called g_mime_utils_header_decode_text() when I process headers.
We know ,when called g_object_unref(GMimeMessage object) , sequentially following methods would be called: g_mime_object_finalize g_mime_event_remove g_mime_event_index_of
In g_mime_object_finalize:
g_mime_object_finalize (GObject object)
{
GMimeObject mime = (GMimeObject ) object;
GMimeEvent event;
...
if (mime->headers) {
event = mime->headers->changed;
// Enter this
g_mime_event_remove (event, (GMimeEventCallback) header_list_changed, object);
g_object_unref (mime->headers);
}
g_free (mime->content_id);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
Did I miss something when I process headers?
I think I found the reason. Sorry for that.
It's my mistake. I shouldn't unref the point returned by g_mime_object_get_header_list.
I called g_mime_utils_header_decode_text in my code like this:
It's no problem,here. But when I called g_object_unref to unref my MimeMessage at the end of my mime parsing:
I tried to debug, and looked into ..... I found the exception fired in this method:
It says event is null. But why?
So I modified like this, it worked: