Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Execute destructors earlier (Florian Schaper, fschaper at intux org)

  • Loading branch information...
commit 0cd2da03090350f3539658b0cd8f920b0395a708 1 parent 40bf103
Marcus Boerger authored
7 Zend/zend.c
View
@@ -805,6 +805,13 @@ void zend_deactivate_modules(TSRMLS_D)
} zend_end_try();
}
+void zend_call_destructors(TSRMLS_D)
+{
+ zend_try {
+ shutdown_destructors(TSRMLS_C);
+ } zend_end_try();
+}
+
void zend_deactivate(TSRMLS_D)
{
/* we're no longer executing anything */
1  Zend/zend.h
View
@@ -450,6 +450,7 @@ END_EXTERN_C()
void zend_activate(TSRMLS_D);
void zend_deactivate(TSRMLS_D);
+void zend_call_destructors(TSRMLS_D);
void zend_activate_modules(TSRMLS_D);
void zend_deactivate_modules(TSRMLS_D);
void zend_post_deactivate_modules(TSRMLS_D);
1  Zend/zend_execute.h
View
@@ -49,6 +49,7 @@ ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_pt
void init_executor(TSRMLS_D);
void shutdown_executor(TSRMLS_D);
+void shutdown_destructors(TSRMLS_D);
ZEND_API void execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);
ZEND_API int zend_is_true(zval *op);
7 Zend/zend_execute_API.c
View
@@ -187,6 +187,12 @@ void init_executor(TSRMLS_D)
EG(float_separator)[0] = '.';
}
+void shutdown_destructors(TSRMLS_D) {
+ zend_try {
+ zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
+ } zend_end_try();
+}
+
void shutdown_executor(TSRMLS_D)
{
zend_try {
@@ -206,7 +212,6 @@ void shutdown_executor(TSRMLS_D)
}
*/
zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
- zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
} zend_end_try();
4 main/main.c
View
@@ -1190,6 +1190,10 @@ void php_request_shutdown(void *dummy)
sapi_send_headers(TSRMLS_C);
} zend_end_try();
+ zend_try {
+ zend_call_destructors(TSRMLS_C);
+ } zend_end_try();
+
if (PG(modules_activated)) zend_try {
php_call_shutdown_functions();
} zend_end_try();
Please sign in to comment.
Something went wrong with that request. Please try again.