diff options
| author | Romolo Manfredini <romolo@php.net> | 2001-03-26 08:00:43 +0000 |
|---|---|---|
| committer | Romolo Manfredini <romolo@php.net> | 2001-03-26 08:00:43 +0000 |
| commit | 99e5dfd00eecc14f36cef86346907f2e5e9b9b07 (patch) | |
| tree | fe953643dd827d1530eb5c2cfdb0d3230220233b /ext/pgsql/pgsql.c | |
| parent | 5a0056842d423a86b83198dc394cbbdf93f4f5cb (diff) | |
| download | php-git-99e5dfd00eecc14f36cef86346907f2e5e9b9b07.tar.gz | |
pg_close was undefining default_conn even if a ref to it was still there.
Diffstat (limited to 'ext/pgsql/pgsql.c')
| -rw-r--r-- | ext/pgsql/pgsql.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 748fc80bc7..7c8924e88d 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,12 +528,15 @@ 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 || (pgsql_link && Z_RESVAL_PP(pgsql_link)==PGG(default_link))) { - if (id!=-1) - zend_list_delete(PGG(default_link)); + zend_list_delete(PGG(default_link)); PGG(default_link) = -1; } |
