From 7b42eccfd6f6c36c2123f1a9d37f48dae2e13386 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Thu, 5 Jun 2003 17:48:51 +0000 Subject: [PATCH] prevent double destroy and double init badness --- ext/xml/xml.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/xml/xml.c b/ext/xml/xml.c index c43ea936c5..7a60a041a2 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -35,6 +35,8 @@ #if HAVE_XML +int xml_parser_inited = 0; + #include "php_xml.h" # include "ext/standard/head.h" @@ -250,7 +252,10 @@ PHP_MSHUTDOWN_FUNCTION(xml) PHP_RSHUTDOWN_FUNCTION(xml) { #ifdef LIBXML_EXPAT_COMPAT - xmlCleanupParser(); + if (xml_parser_inited) { + xmlCleanupParser(); + xml_parser_inited = 0; + } #endif return SUCCESS; } -- 2.50.1