[evolution] Initialize libxml2 global memory in the main()



commit 76a6c1f948b6d8ea60a56bffddbfd9d3ff3ea0b5
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 4 09:43:09 2017 +0200

    Initialize libxml2 global memory in the main()
    
    There could happen crashes in libxml2 when being used for the first
    time in multiple threads at once, like with xmlFindCharEncodingHandler()
    function. This and some others require initialization in the main thread.
    
    One example of such crash can be found in a downstream bug report:
    https://bugzilla.redhat.com/show_bug.cgi?id=1380268

 src/calendar/alarm-notify/notify-main.c |    4 ++--
 src/shell/main.c                        |    6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/calendar/alarm-notify/notify-main.c b/src/calendar/alarm-notify/notify-main.c
index c827f15..84b20cd 100644
--- a/src/calendar/alarm-notify/notify-main.c
+++ b/src/calendar/alarm-notify/notify-main.c
@@ -32,9 +32,7 @@
 #include "alarm-notify.h"
 #include "config-data.h"
 
-#ifdef G_OS_WIN32
 #include <libedataserver/libedataserver.h>
-#endif
 
 #include "e-util/e-util-private.h"
 
@@ -68,6 +66,8 @@ main (gint argc,
 
        gtk_init (&argc, &argv);
 
+       e_xml_initialize_in_main ();
+
        alarm_notify_service = alarm_notify_new (NULL, &error);
 
        if (error != NULL) {
diff --git a/src/shell/main.c b/src/shell/main.c
index 2863d35..f7171fc 100644
--- a/src/shell/main.c
+++ b/src/shell/main.c
@@ -44,13 +44,10 @@
 
 #include <windows.h>
 #include "e-util/e-util-private.h"
-#include <libedataserver/libedataserver.h>
 
 #endif
 
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
+#include <libedataserver/libedataserver.h>
 
 #include <webkit2/webkit2.h>
 
@@ -568,6 +565,7 @@ main (gint argc,
 
        e_util_init_main_thread (NULL);
        e_passwords_init ();
+       e_xml_initialize_in_main ();
 
        gtk_window_set_default_icon_name ("evolution");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]