From: Derick Rethans Date: Wed, 14 Sep 2005 20:08:31 +0000 (+0000) Subject: - Fixed shutdown order before RC2. X-Git-Tag: php-5.1.0RC2~256 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5f0cbed448d9a057c8cf451074b870e27a335fd;p=php - Fixed shutdown order before RC2. --- diff --git a/main/main.c b/main/main.c index cb58163e24..5362e16b23 100644 --- a/main/main.c +++ b/main/main.c @@ -1200,16 +1200,16 @@ void php_request_shutdown(void *dummy) EG(opline_ptr) = NULL; EG(active_op_array) = NULL; - /* 1. Call all possible __destruct() functions */ - zend_try { - zend_call_destructors(TSRMLS_C); - } zend_end_try(); - - /* 2. Call all possible shutdown functions registered with register_shutdown_function() */ + /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ if (PG(modules_activated)) zend_try { php_call_shutdown_functions(TSRMLS_C); } zend_end_try(); + /* 2. Call all possible __destruct() functions */ + zend_try { + zend_call_destructors(TSRMLS_C); + } zend_end_try(); + /* 3. Flush all output buffers */ zend_try { php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);