Index: ext/pdo/pdo_dbh.c =================================================================== RCS file: /repository/php-src/ext/pdo/pdo_dbh.c,v retrieving revision 1.82.2.10 diff -u -p -d -r1.82.2.10 pdo_dbh.c --- ext/pdo/pdo_dbh.c 3 Oct 2005 03:54:06 -0000 1.82.2.10 +++ ext/pdo/pdo_dbh.c 3 Oct 2005 23:10:41 -0000 @@ -1337,6 +1337,8 @@ void pdo_dbh_init(TSRMLS_D) static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) { + int i; + if (--dbh->refcount) return; @@ -1357,8 +1359,11 @@ static void dbh_free(pdo_dbh_t *dbh TSRM if (dbh->def_stmt_ctor_args) { zval_ptr_dtor(&dbh->def_stmt_ctor_args); } - if (dbh->cls_methods) { - zend_hash_destroy(&dbh->cls_methods); + + for (i = 0; i < PDO_DBH_DRIVER_METHOD_KIND__MAX; i++) { + if (dbh->cls_methods[i]) { + zend_hash_destroy(dbh->cls_methods[i]); + } } pefree(dbh, dbh->is_persistent);