diff options
Diffstat (limited to 'ext/xml/xml.c')
-rw-r--r-- | ext/xml/xml.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 181a208fd7..af0d25dc2d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -231,7 +231,10 @@ PHP_MINIT_FUNCTION(xml) php_xml_mem_hdlrs.free_fcn = php_xml_free_wrapper; #ifdef LIBXML_EXPAT_COMPAT - xmlInitThreads(); + if (!xml_parser_inited) { + xmlInitThreads(); + xml_parser_inited = 1; + } #endif return SUCCESS; } @@ -245,18 +248,18 @@ PHP_RINIT_FUNCTION(xml) PHP_MSHUTDOWN_FUNCTION(xml) { +#ifdef LIBXML_EXPAT_COMPAT + if (xml_parser_inited) { + xmlCleanupParser(); + xml_parser_inited = 0; + } +#endif return SUCCESS; } PHP_RSHUTDOWN_FUNCTION(xml) { -#ifdef LIBXML_EXPAT_COMPAT - if (xml_parser_inited) { - xmlCleanupParser(); - xml_parser_inited = 0; - } -#endif return SUCCESS; } |