Re: [PHP4BETA] cvs: /php4/ext/odbc php_odbc.h php_odbc.c
| From: | Leo Baschy | Date: | Sun, 12 Mar 2000 15:11:10 +0000 |
| Subject: | Re: [PHP4BETA] cvs: /php4/ext/odbc php_odbc.h php_odbc.c | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11940@lists.php.net to get a copy of this message | ||
This snippet works great here and if it doesn't for you I'd like to know why:
static void _close_odbc_conn(odbc_connection *conn)
{
ODBCLS_FETCH();
ELS_FETCH();
void *ptr;
int type;
int i, nument = zend_hash_next_free_element(&EG(regular_list));
odbc_result *pv_res;
for(i = 1; i < nument; i++) {
ptr = zend_list_find(i, &type);
if (ptr && (type == le_result)) {
pv_res = (odbc_result *)ptr;
if (pv_res->conn_ptr == conn) {
zend_list_delete(i);
};
};
};
SQLDisconnect(conn->hdbc);
SQLFreeConnect(conn->hdbc);
SQLFreeEnv(conn->henv);
efree(conn);
ODBCG(num_links)--;
}
There are a few details elsewhere in php_odbc.c that I would say were left messy by previous
authors, e.g. inconsistent handling of reference counters. That's not the point to attack
here. I'll clean that up if this gets "approved" as "working ok". Also
there will be a couple of speed optimizations on this, e.g. delete results in close_all.
Anyway, before continuing on ironing out all details it would be interesting to know whether there
are any technical objections to this.
- Leo Baschy <nirvana@got.net>