tony2001                Mon Oct  3 19:27:32 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src/ext/pdo    pdo_dbh.c 
  Log:
  free cls_methods correctly and fix segfault on shutdown
  (no bug entry and MFB, though..)
  
  
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.10&r2=1.82.2.11&ty=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.10 php-src/ext/pdo/pdo_dbh.c:1.82.2.11
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.10 Sun Oct  2 23:54:06 2005
+++ php-src/ext/pdo/pdo_dbh.c   Mon Oct  3 19:27:26 2005
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_dbh.c,v 1.82.2.10 2005/10/03 03:54:06 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.11 2005/10/03 23:27:26 tony2001 Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -1337,6 +1337,8 @@
 
 static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC)
 {
+       int i;
+       
        if (--dbh->refcount)
                return;
 
@@ -1357,8 +1359,11 @@
        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);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to