lib: call g_type_init from notmuch_database_open

We want to make sure g_type_init is called before any GObject
functionality is used.
This commit is contained in:
David Bremner 2011-12-04 15:20:39 -04:00
parent 398b94bb39
commit 69dc421ab3

View file

@ -26,6 +26,7 @@
#include <signal.h> #include <signal.h>
#include <glib.h> /* g_free, GPtrArray, GHashTable */ #include <glib.h> /* g_free, GPtrArray, GHashTable */
#include <glib-object.h> /* g_type_init */
using namespace std; using namespace std;
@ -600,6 +601,9 @@ notmuch_database_open (const char *path,
goto DONE; goto DONE;
} }
/* Initialize the GLib type system and threads */
g_type_init ();
notmuch = talloc (NULL, notmuch_database_t); notmuch = talloc (NULL, notmuch_database_t);
notmuch->exception_reported = FALSE; notmuch->exception_reported = FALSE;
notmuch->path = talloc_strdup (notmuch, path); notmuch->path = talloc_strdup (notmuch, path);