diff options
author | Romolo Manfredini <romolo@php.net> | 2001-03-27 10:22:32 +0000 |
---|---|---|
committer | Romolo Manfredini <romolo@php.net> | 2001-03-27 10:22:32 +0000 |
commit | e7875fc20dedeee313cc8c0d714ccbb27c73fe69 (patch) | |
tree | a73ccefdd22156954eca2b9f4d69e176b7c230ed | |
parent | f446cc2e3fcbd05f4ce013f083b172298dd6aa69 (diff) | |
download | php-git-e7875fc20dedeee313cc8c0d714ccbb27c73fe69.tar.gz |
pg_close was closing connection twice, pls insert in 4_0_5
-rw-r--r-- | ext/pgsql/pgsql.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 4e9755bfea..1feab4199d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -501,7 +501,8 @@ PHP_FUNCTION(pg_pconnect) PHP_FUNCTION(pg_close) { zval **pgsql_link = NULL; - int id; + void *ptr; + int id, type; PGconn *pgsql; PGLS_FETCH(); @@ -527,6 +528,10 @@ PHP_FUNCTION(pg_close) if (id==-1) { /* explicit resource number */ zend_list_delete(Z_RESVAL_PP(pgsql_link)); + ptr = zend_list_find(Z_RESVAL_PP(pgsql_link),&type); + if (ptr && (type==le_link || type==le_plink)) { + RETURN_TRUE; + } } if (id!=-1 |