com php-src: Only destruct if EG(active) in zend_shutdown( ). (bug #65463, #66036) : Zend/zend.c
| From: | Stanislav Malyshev | Date: | Sat, 23 Aug 2014 14:17:37 +0000 |
| Subject: | com php-src: Only destruct if EG(active) in zend_shutdown( ). (bug #65463, #66036) : Zend/zend.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81340@lists.php.net to get a copy of this message | ||
Commit: 437612f65615a93fe338fd5c25acb82d3e81a6f7
Author: Keyur Govande <keyur_govande@yahoo.com> Sat, 23 Aug 2014 14:17:37 +0000
Parents: 5e338836ff4f52107ae722322ffe92b8cd7d3aa3
Branches: PHP-5.4 PHP-5..5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=437612f65615a93fe338fd5c25acb82d3e81a6f7
Log:
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Bugs:
https://bugs.php.net/65463
https://bugs.php.net/66036
Changed paths:
M Zend/zend.c
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index e0f400a..35f215f 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -818,15 +818,18 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
#endif
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
- /*
- * The order of destruction is important here.
- * See bugs #65463 and 66036.
- */
- zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full
TSRMLS_CC);
- zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data
TSRMLS_CC);
- zend_cleanup_internal_classes(TSRMLS_C);
- zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full
TSRMLS_CC);
- zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full
TSRMLS_CC);
+ if (EG(active))
+ {
+ /*
+ * The order of destruction is important here.
+ * See bugs #65463 and 66036.
+ */
+ zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full
TSRMLS_CC);
+ zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data
TSRMLS_CC);
+ zend_cleanup_internal_classes(TSRMLS_C);
+ zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full
TSRMLS_CC);
+ zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full
TSRMLS_CC);
+ }
zend_destroy_modules();