static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
{
+ int i;
+
if (--dbh->refcount)
return;
if (dbh->def_stmt_ctor_args) {
zval_ptr_dtor(&dbh->def_stmt_ctor_args);
}
+
+ 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->cls_methods[i], dbh->is_persistent);
+ }
+ }
pefree(dbh, dbh->is_persistent);
}
efree(dbh->properties);
dbh->properties = NULL;
}
- if (dbh->cls_methods) {
- zend_hash_destroy(&dbh->cls_methods);
- }
if (!dbh->is_persistent) {
dbh_free(dbh TSRMLS_CC);