From 838d30a5cdad56b973c6e220d4d1599e4e0fa2c5 Mon Sep 17 00:00:00 2001 From: Rob Richards Date: Fri, 23 Apr 2004 17:31:44 +0000 Subject: [PATCH] move libxml error handler ro rinit/rshutdown to keep it local to php --- ext/libxml/libxml.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 77a3df64a3..a6e68a21df 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -400,9 +400,6 @@ PHP_LIBXML_API void php_libxml_initialize() { php_libxml_streams_IO_write, php_libxml_streams_IO_close); - /* report errors via handler rather than stderr */ - xmlSetGenericErrorFunc(NULL, php_libxml_error_handler); - zend_hash_init(&php_libxml_exports, 0, NULL, NULL, 1); _php_libxml_initialized = 1; @@ -411,8 +408,6 @@ PHP_LIBXML_API void php_libxml_initialize() { PHP_LIBXML_API void php_libxml_shutdown() { if (_php_libxml_initialized) { - /* reset libxml generic error handling */ - xmlSetGenericErrorFunc(NULL, NULL); xmlCleanupParser(); zend_hash_destroy(&php_libxml_exports); _php_libxml_initialized = 0; @@ -436,6 +431,9 @@ PHP_MINIT_FUNCTION(libxml) PHP_RINIT_FUNCTION(libxml) { + /* report errors via handler rather than stderr */ + xmlSetGenericErrorFunc(NULL, php_libxml_error_handler); + return SUCCESS; } @@ -450,6 +448,9 @@ PHP_MSHUTDOWN_FUNCTION(libxml) PHP_RSHUTDOWN_FUNCTION(libxml) { + /* reset libxml generic error handling */ + xmlSetGenericErrorFunc(NULL, NULL); + smart_str_free(&LIBXML(error_buffer)); return SUCCESS; } -- 2.40.0