From fcb901a77a0a3eaf21f0126466ae84fdc18fce2c Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 3 Sep 2011 23:59:25 +0200 Subject: [PATCH] Fix up xmlCleanupParser sequence. * xml.c (parse_region): Don't call xmlCleanupParser after parsing, since this reportedly can destroy thread storage. * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown. --- src/ChangeLog | 7 +++++++ src/emacs.c | 4 ++++ src/xml.c | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 52ec796d6c..de12d8f031 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-09-03 Lars Magne Ingebrigtsen + + * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown. + + * xml.c (parse_region): Don't call xmlCleanupParser after parsing, + since this reportedly can destroy thread storage. + 2011-08-30 Chong Yidong * syntax.c (find_defun_start): Update all cache variables if diff --git a/src/emacs.c b/src/emacs.c index 7039f063dc..f68c47ffed 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2097,6 +2097,10 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff) #ifdef HAVE_NS ns_term_shutdown (sig); #endif + +#ifdef HAVE_LIBXML2 + xmlCleanupParser (); +#endif } diff --git a/src/xml.c b/src/xml.c index 55352baae3..8b485e7364 100644 --- a/src/xml.c +++ b/src/xml.c @@ -141,7 +141,6 @@ parse_region (Lisp_Object start, Lisp_Object end, Lisp_Object base_url, int html Fcons (Qnil, Fnreverse (Fcons (r, result)))); xmlFreeDoc (doc); - xmlCleanupParser (); } return result; -- 2.20.1