[PATCH 0/2] Multiples calls of g_mime_init

Kazuo Teramoto kaz.rag at gmail.com
Fri Dec 30 13:58:08 PST 2011


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



More information about the notmuch mailing list