File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -813,6 +813,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
813813 zend_shutdown_timeout_thread ();
814814#endif
815815 zend_destroy_rsrc_list (& EG (persistent_list ) TSRMLS_CC );
816+
817+ if (EG (active ))
818+ {
819+ /*
820+ * The order of destruction is important here.
821+ * See bugs #65463 and 66036.
822+ */
823+ zend_hash_reverse_apply (GLOBAL_FUNCTION_TABLE , (apply_func_t ) zend_cleanup_function_data_full TSRMLS_CC );
824+ zend_hash_reverse_apply (GLOBAL_CLASS_TABLE , (apply_func_t ) zend_cleanup_user_class_data TSRMLS_CC );
825+ zend_cleanup_internal_classes (TSRMLS_C );
826+ zend_hash_reverse_apply (GLOBAL_FUNCTION_TABLE , (apply_func_t ) clean_non_persistent_function_full TSRMLS_CC );
827+ zend_hash_reverse_apply (GLOBAL_CLASS_TABLE , (apply_func_t ) clean_non_persistent_class_full TSRMLS_CC );
828+ }
829+
816830 zend_destroy_modules ();
817831
818832 zend_hash_destroy (GLOBAL_FUNCTION_TABLE );
Original file line number Diff line number Diff line change @@ -639,6 +639,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
639639ZEND_API void zend_cleanup_internal_classes (TSRMLS_D );
640640ZEND_API int zend_cleanup_function_data (zend_function * function TSRMLS_DC );
641641ZEND_API int zend_cleanup_function_data_full (zend_function * function TSRMLS_DC );
642+ ZEND_API int clean_non_persistent_function_full (zend_function * function TSRMLS_DC );
643+ ZEND_API int clean_non_persistent_class_full (zend_class_entry * * ce TSRMLS_DC );
642644
643645ZEND_API void destroy_zend_function (zend_function * function TSRMLS_DC );
644646ZEND_API void zend_function_dtor (zend_function * function );
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
108108}
109109/* }}} */
110110
111- static int clean_non_persistent_function_full (zend_function * function TSRMLS_DC ) /* {{{ */
111+ ZEND_API int clean_non_persistent_function_full (zend_function * function TSRMLS_DC ) /* {{{ */
112112{
113113 return (function -> type == ZEND_INTERNAL_FUNCTION ) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE ;
114114}
@@ -120,7 +120,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
120120}
121121/* }}} */
122122
123- static int clean_non_persistent_class_full (zend_class_entry * * ce TSRMLS_DC ) /* {{{ */
123+ ZEND_API int clean_non_persistent_class_full (zend_class_entry * * ce TSRMLS_DC ) /* {{{ */
124124{
125125 return ((* ce )-> type == ZEND_INTERNAL_CLASS ) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE ;
126126}
You can’t perform that action at this time.
0 commit comments