summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2000-01-15 13:35:06 +0000
committerThies C. Arntzen <thies@php.net>2000-01-15 13:35:06 +0000
commitb42603eee68d8e0f2546052016b0009a3490ac9e (patch)
treefd19cb3cd5493010b5f2085861ff22b4e8ea72af /ext/odbc/php_odbc.c
parentc7667cec629e25ede488ce5f5c558d46d20a2a00 (diff)
downloadphp-git-b42603eee68d8e0f2546052016b0009a3490ac9e.tar.gz
in an rshutdown function we should not access the regular_list like this.
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 691f7765e5..aaa31503fc 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -410,6 +410,17 @@ PHP_MINIT_FUNCTION(odbc)
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 @@ PHP_RINIT_FUNCTION(odbc)
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;
}