mike            Mon May 29 16:53:56 2006 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/mysqli/tests   bug36949.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/mysqli mysqli.c 
  Log:
  - Fixed bug #36949 (invalid internal mysqli objects dtor)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.61&r2=1.2027.2.547.2.62&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.61 php-src/NEWS:1.2027.2.547.2.62
--- php-src/NEWS:1.2027.2.547.2.61      Mon May 29 11:00:32 2006
+++ php-src/NEWS        Mon May 29 16:53:56 2006
@@ -97,6 +97,7 @@
 - Fixed bug #37256 (php-fastcgi dosen't handle connection abort). (Dmitry)
 - Fixed bug #37244 (Added strict flag to base64_decode() that enforces 
   RFC3548 compliance). (Ilia)
+- Fixed bug #36949 (invalid internal mysqli objects dtor). (Mike)
 - Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
 - Fixed bug #35512 (Lack of read permission on main script results in 
   E_WARNING rather then E_ERROR). (Ilia)
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16.2.3&r2=1.72.2.16.2.4&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16.2.3 
php-src/ext/mysqli/mysqli.c:1.72.2.16.2.4
--- php-src/ext/mysqli/mysqli.c:1.72.2.16.2.3   Wed May 10 11:53:13 2006
+++ php-src/ext/mysqli/mysqli.c Mon May 29 16:53:56 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.72.2.16.2.3 2006/05/10 11:53:13 andrey Exp $ 
+  $Id: mysqli.c,v 1.72.2.16.2.4 2006/05/29 16:53:56 mike Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -135,22 +135,7 @@
 static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
 {
        mysqli_object   *intern = (mysqli_object *)object;
-
-       zend_object_std_dtor(&intern->zo TSRMLS_CC);
-       efree(intern);
-}
-/* }}} */
-
-/* {{{ mysqli_objects_destroy_object
- */
-static void mysqli_objects_destroy_object(void *object, zend_object_handle 
handle TSRMLS_DC)
-{
-       mysqli_object   *intern = (mysqli_object *)object;
-       MYSQLI_RESOURCE *my_res;
-
-       zend_objects_destroy_object(object, handle TSRMLS_CC);
-       
-       my_res = (MYSQLI_RESOURCE *)intern->ptr;
+       MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
 
        /* link object */
        if (instanceof_function(intern->zo.ce, mysqli_link_class_entry 
TSRMLS_CC)) {
@@ -179,6 +164,9 @@
        }
        intern->ptr = NULL;
        my_efree(my_res);
+       
+       zend_object_std_dtor(&intern->zo TSRMLS_CC);
+       efree(intern);
 }
 /* }}} */
 
@@ -360,7 +348,7 @@
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref,
                                        (void *) &tmp, sizeof(zval *));
 
-       retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t) mysqli_objects_destroy_object, 
(zend_objects_free_object_storage_t) mysqli_objects_free_storage, NULL 
TSRMLS_CC);
+       retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t) zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) mysqli_objects_free_storage, NULL 
TSRMLS_CC);
        retval.handlers = &mysqli_object_handlers;
 
        return retval;

http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/tests/bug36949.phpt?view=markup&rev=1.1
Index: php-src/ext/mysqli/tests/bug36949.phpt
+++ php-src/ext/mysqli/tests/bug36949.phpt

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

Reply via email to