From 629f5f7427f2e03a3e1bfb5340d36f5775b62476 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 2 Mar 2009 03:40:59 +0300 Subject: [PATCH] * Try not to unref parser too early --- src/message.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/message.c b/src/message.c index 9499a343be..98c710fe8f 100644 --- a/src/message.c +++ b/src/message.c @@ -321,24 +321,22 @@ process_message (struct worker_task *task) /* create a new parser object to parse the stream */ parser = g_mime_parser_new_with_stream (stream); - /* unref the stream (parser owns a ref, so this object does not actually get free'd until we destroy the parser) */ - g_object_unref (stream); - /* parse the message from the stream */ message = g_mime_parser_construct_message (parser); task->message = message; memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_object_unref, task->message); - /* free the parser (and the stream) */ - g_object_unref (parser); - g_mime_message_foreach_part (message, mime_foreach_callback, task); msg_info ("process_message: found %d parts in message", task->parts_count); task->worker->srv->stat->messages_scanned ++; + /* free the parser (and the stream) */ + g_object_unref (parser); + g_object_unref (stream); + return 0; } -- 2.47.3