diff options
| author | David Bremner <david@tethera.net> | 2021-05-09 17:33:48 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2021-05-13 22:21:57 -0300 |
| commit | 8410be8e0867820c9814d06b49ff6da822d384a3 (patch) | |
| tree | 7e5f132d32eba50b3688d37d96a9f685e1216209 /lib/message-file.c | |
| parent | a34d7b41444ad2fb50cc7def25659c88d439780a (diff) | |
lib: make glib initialization thread-safe
In principle this could be done without depending on C++11 features,
but these features should be available since gcc 4.8.1, and this
localized usage is easy to replace if it turns out to be problematic
for portability.
Diffstat (limited to 'lib/message-file.c')
| -rw-r--r-- | lib/message-file.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/message-file.c b/lib/message-file.c index 9e9b387f..647ccf3a 100644 --- a/lib/message-file.c +++ b/lib/message-file.c @@ -141,7 +141,6 @@ _notmuch_message_file_parse (notmuch_message_file_t *message) { GMimeParser *parser; notmuch_status_t status = NOTMUCH_STATUS_SUCCESS; - static int initialized = 0; bool is_mbox; if (message->message) @@ -149,10 +148,7 @@ _notmuch_message_file_parse (notmuch_message_file_t *message) is_mbox = _is_mbox (message->stream); - if (! initialized) { - g_mime_init (); - initialized = 1; - } + _notmuch_init (); message->headers = g_hash_table_new_full (strcase_hash, strcase_equal, free, g_free); |
