]> granicus.if.org Git - php/commitdiff
Fixed bug #45352 (Segmentation fault because of tick function on second request)
authorDmitry Stogov <dmitry@php.net>
Wed, 25 Jun 2008 12:18:22 +0000 (12:18 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 25 Jun 2008 12:18:22 +0000 (12:18 +0000)
NEWS
main/main.c
main/php_ticks.c
main/php_ticks.h

diff --git a/NEWS b/NEWS
index a24c01d94ec80c6b66128fb4e22af9a509dd914c..9a50ed7d343c494fa813d3902d64007dc0e40d56 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP                                                                        NEWS
   functions. (Andrey)
 - Fixed a bug where exec() on Windows would eat the first and last double quotes
   (Scott)
+- Fixed bug #45352 (Segmentation fault because of tick function on second
+  request). (Dmitry)
 - Fixed bug #45312 (Segmentation fault on second request for array functions).
   (Dmitry)
 - Fixed bug #45251 (double free or corruption with setAttributeNode()). (Rob)
index 685fa9d7d35d1cb4aa54592f4e287efdf5f3bb19..7925626635f0e304d2258957dba5edc3a2fbb2c2 100644 (file)
@@ -1435,6 +1435,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);
index c9fa5e4e9bf47ad63abc1ba87055e00827f2f219..ffc1dabf5941c586ad8d7c0c0b7d1eb00fe3bc12 100644 (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));
index d3d0ae1509fe389285158df926ee1233a70d8aea..9dc930746f4ceea440d2bfb7569bcc81a681ac44 100644 (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);