diff options
author | Xinchen Hui <laruence@php.net> | 2015-03-25 13:05:08 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-03-25 13:05:08 +0800 |
commit | fe0ca2745f00940a27bfc8e87db534541a19af70 (patch) | |
tree | 9f6ecb6d7dd517f46f71bfc12cdeebd17f8fc904 /Zend/zend.c | |
parent | ef2db26c60537e84b502608ff404263d5f4dc5d2 (diff) | |
parent | 968fbc6acf0bc27be17c0209be7f966e89a55943 (diff) | |
download | php-git-fe0ca2745f00940a27bfc8e87db534541a19af70.tar.gz |
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4
Diffstat (limited to 'Zend/zend.c')
-rw-r--r-- | Zend/zend.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 1189875f37..6d74ca6890 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -813,6 +813,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */ zend_shutdown_timeout_thread(); #endif zend_destroy_rsrc_list(&EG(persistent_list) 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(); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); |