Permalink
Browse files

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

  • Loading branch information...
1 parent 40bf103 commit 0cd2da03090350f3539658b0cd8f920b0395a708 Marcus Boerger committed Jul 25, 2004
Showing with 19 additions and 1 deletion.
  1. +7 −0 Zend/zend.c
  2. +1 −0 Zend/zend.h
  3. +1 −0 Zend/zend_execute.h
  4. +6 −1 Zend/zend_execute_API.c
  5. +4 −0 main/main.c
View
7 Zend/zend.c
@@ -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 */
View
1 Zend/zend.h
@@ -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);
View
1 Zend/zend_execute.h
@@ -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);
View
7 Zend/zend_execute_API.c
@@ -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();
View
4 main/main.c
@@ -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();

0 comments on commit 0cd2da0

Please sign in to comment.