From: Antony Dovgal Date: Wed, 24 May 2006 21:22:13 +0000 (+0000) Subject: fix #37418 (tidy module crashes CLI version of PHP) X-Git-Tag: php-5.2.0RC1~474 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cb3d1827683de96dd830b8ead97eb60ff57ae36;p=php fix #37418 (tidy module crashes CLI version of PHP) --- diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h index 3beff75dd8..3f910e46ef 100644 --- a/ext/tidy/php_tidy.h +++ b/ext/tidy/php_tidy.h @@ -40,6 +40,7 @@ extern zend_module_entry tidy_module_entry; #define TIDY_ATTR_ME(name, param) TIDY_METHOD_MAP(name, tam_ ##name, param) PHP_MINIT_FUNCTION(tidy); +PHP_MSHUTDOWN_FUNCTION(tidy); PHP_RINIT_FUNCTION(tidy); PHP_MINFO_FUNCTION(tidy); diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index f3e29f5e24..31d09b4a82 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -326,7 +326,7 @@ zend_module_entry tidy_module_entry = { "tidy", tidy_functions, PHP_MINIT(tidy), - NULL, + PHP_MSHUTDOWN(tidy), PHP_RINIT(tidy), NULL, PHP_MINFO(tidy), @@ -1000,6 +1000,17 @@ PHP_RINIT_FUNCTION(tidy) return SUCCESS; } +PHP_MSHUTDOWN_FUNCTION(tidy) +{ +#ifdef ZTS + ts_free_id(tidy_globals_id); +#else + tidy_globals_dtor(&tidy_globals TSRMLS_CC); +#endif + UNREGISTER_INI_ENTRIES(); + return SUCCESS; +} + PHP_MINFO_FUNCTION(tidy) { php_info_print_table_start();