cvs: /php4/ext/odbc php_odbc.c

From: Date: Sat, 15 Jan 2000 13:35:36 +0000
Subject: cvs: /php4/ext/odbc php_odbc.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-9144@lists.php.net to get a copy of this message
thies Sat Jan 15 05:35:36 2000 EDT Modified files: /php4/ext/odbc php_odbc.c Log: in an rshutdown function we should not access the regular_list like this. Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.25 php4/ext/odbc/php_odbc.c:1.26 --- php4/ext/odbc/php_odbc.c:1.25 Sun Jan 2 07:59:01 2000 +++ php4/ext/odbc/php_odbc.c Sat Jan 15 05:35:06 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.25 2000/01/02 15:59:01 kara Exp $ */ +/* $Id: php_odbc.c,v 1.26 2000/01/15 13:35:06 thies Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" @@ -410,6 +410,17 @@ return SUCCESS; } +void _php_odbc_shutdown(void *data) +{ + ELS_FETCH(); + + /* Close all statements before connection */ + + /* this is not the nice way of doing it - we should use reference counting + of the parent handles */ + + zend_hash_apply(&EG(regular_list), (int (*)(void *)) _odbc_stmt_cleanup); +} PHP_RINIT_FUNCTION(odbc) { @@ -417,15 +428,14 @@ ODBCG(defConn) = -1; ODBCG(num_links) = ODBCG(num_persistent); + + php_register_pre_request_shutdown(_php_odbc_shutdown, NULL); + return SUCCESS; } PHP_RSHUTDOWN_FUNCTION(odbc) { - ELS_FETCH(); - - /* Close all statements before connection */ - zend_hash_apply(&EG(regular_list), (int (*)(void *)) _odbc_stmt_cleanup); return SUCCESS; }

« previous php.version4 (#9144) next »