summaryrefslogtreecommitdiff
path: root/ext/fbsql/php_fbsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fbsql/php_fbsql.c')
-rw-r--r--ext/fbsql/php_fbsql.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c
index 251365738d..5467ace8e1 100644
--- a/ext/fbsql/php_fbsql.c
+++ b/ext/fbsql/php_fbsql.c
@@ -673,7 +673,8 @@ PHP_FUNCTION(fbsql_close)
{
PHPFBLink* phpLink = NULL;
zval **fbsql_link_index = NULL;
- int id;
+ int id, i, nument, type;
+ void *ptr;
switch (ZEND_NUM_ARGS()) {
case 0:
@@ -692,6 +693,19 @@ PHP_FUNCTION(fbsql_close)
}
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
+ nument = zend_hash_next_free_element(&EG(regular_list));
+ for (i = 1; i < nument; i++) {
+ ptr = zend_list_find(i, &type);
+ if (ptr && (type == le_result)) {
+ PHPFBResult *result;
+
+ result = (PHPFBResult *)ptr;
+ if (result->link == phpLink) {
+ zend_list_delete(i);
+ }
+ }
+ }
+
if (id==-1) { /* explicit resource number */
zend_list_delete(Z_RESVAL_PP(fbsql_link_index));
}