Fixed bug #45352 (Segmentation fault because of tick function on second request)

This commit is contained in:
Dmitry Stogov 2008-06-25 12:18:36 +00:00
parent c5ec48e858
commit 531b31ca08
3 changed files with 8 additions and 0 deletions

View file

@ -1472,6 +1472,8 @@ void php_request_shutdown(void *dummy)
EG(opline_ptr) = NULL;
EG(active_op_array) = NULL;
php_deactivate_ticks(TSRMLS_C);
/* 1. Call all possible shutdown functions registered with register_shutdown_function() */
if (PG(modules_activated)) zend_try {
php_call_shutdown_functions(TSRMLS_C);

View file

@ -27,6 +27,11 @@ int php_startup_ticks(TSRMLS_D)
return SUCCESS;
}
void php_deactivate_ticks(TSRMLS_D)
{
zend_llist_clean(&PG(tick_functions));
}
void php_shutdown_ticks(TSRMLS_D)
{
zend_llist_destroy(&PG(tick_functions));

View file

@ -22,6 +22,7 @@
#define PHP_TICKS_H
int php_startup_ticks(TSRMLS_D);
void php_deactivate_ticks(TSRMLS_D);
void php_shutdown_ticks(TSRMLS_D);
void php_run_ticks(int count);