[PATCH 0/2] Multiples calls of g_mime_init

Subject: [PATCH 0/2] Multiples calls of g_mime_init

Date: Fri, 30 Dec 2011 19:58:08 -0200

To: notmuch@notmuchmail.org, David Bremner

Cc:

From: Kazuo Teramoto


The gmime docs don't says if is ok to call g_mime_init multiple times,
but the code have a check for it in a form like this:
~~~~~~~~
static unsigned int initialized = 0;
g_mime_init (guint32 flags)
{
    if (initialized++)
        return;
~~~~~~~~
so the init code is run only once and notmuch don't need to explicit
check for an already initialized gmime.

This make possible to call g_mime_init again in lib/database.cc and this
call really solve the OP segmentation fault in python bindings.

Kazuo Teramoto (2):
  lib: Remove unnecessary checks when calling g_mime_init
  lib: call g_mime_init from notmuch_database_open

 lib/database.cc    |    5 +++++
 lib/index.cc       |    4 ----
 lib/message-file.c |    4 ----
 3 files changed, 5 insertions(+), 8 deletions(-)

-- 
1.7.8.1


Thread: