cvs: php4 /ext/pgsql pgsql.c
| From: | Jouni Ahto | Date: | Wed, 05 Jul 2000 22:17:31 +0000 |
| Subject: | cvs: php4 /ext/pgsql pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-638@lists.php.net to get a copy of this message | ||
jah Wed Jul 5 15:17:31 2000 EDT
Modified files:
/php4/ext/pgsql pgsql.c
Log:
- Still one misssing zend_list_addref() and small fix in pg_close.
Fixes #5349 (but not the way reporter wants...).
# There's something in the way database_connect/close functions behave when
# implemented the way as in mysql module that I find a bit strange... because
# of that extra zend_list_addref() there to prevent default link disappearing
# if it's not assigned to variable, when it is, I guess its' reference count
# is at this point 2, I can do: open a db link and assign it to a variable,
# close the link and still use it afterwards.
Index: php4/ext/pgsql/pgsql.c
diff -u php4/ext/pgsql/pgsql.c:1.62 php4/ext/pgsql/pgsql.c:1.63
--- php4/ext/pgsql/pgsql.c:1.62 Sun Jul 2 01:59:44 2000
+++ php4/ext/pgsql/pgsql.c Wed Jul 5 15:17:30 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.62 2000/07/02 08:59:44 hirokawa Exp $ */
+/* $Id: pgsql.c,v 1.63 2000/07/05 22:17:30 jah Exp $ */
#include <stdlib.h>
@@ -370,6 +370,7 @@
if (ptr && (type==le_link || type==le_plink)) {
return_value->value.lval = PGG(default_link) = link;
return_value->type = IS_RESOURCE;
+ zend_list_addref(link);
efree(hashed_details);
return;
} else {
@@ -462,7 +463,7 @@
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, pgsql_link, id, "PostgreSQL link", le_link,
le_plink);
- zend_list_delete(Z_LVAL_PP(pgsql_link));
+ zend_list_delete(id);
RETURN_TRUE;
}
/* }}} */