tony2001                Wed Mar 29 15:08:52 2006 UTC

  Modified files:              
    /ZendEngine2        zend_objects.c zend_objects.h 
    /php-src/ext/com_dotnet     com_persist.c 
    /php-src/ext/date   php_date.c 
    /php-src/ext/dom    php_dom.c 
    /php-src/ext/mysqli mysqli.c 
    /php-src/ext/reflection     php_reflection.c 
    /php-src/ext/simplexml      simplexml.c 
    /php-src/ext/spl    spl_array.c spl_directory.c spl_iterators.c 
                        spl_observer.c 
    /php-src/ext/sqlite sqlite.c 
    /php-src/ext/tidy   tidy.c 
    /php-src/ext/xmlreader      php_xmlreader.c 
    /php-src/ext/xmlwriter      php_xmlwriter.c 
    /php-src/ext/xsl    php_xsl.c 
  Log:
  MF51: fix bug #36898 (__set() leaks in classes extending internal ones)
      
  Added:
  ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC)
  ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
  
  
  
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.c?r1=1.65&r2=1.66&diff_format=u
Index: ZendEngine2/zend_objects.c
diff -u ZendEngine2/zend_objects.c:1.65 ZendEngine2/zend_objects.c:1.66
--- ZendEngine2/zend_objects.c:1.65     Thu Mar 16 10:33:23 2006
+++ ZendEngine2/zend_objects.c  Wed Mar 29 15:08:51 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.c,v 1.65 2006/03/16 10:33:23 dmitry Exp $ */
+/* $Id: zend_objects.c,v 1.66 2006/03/29 15:08:51 tony2001 Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -25,6 +25,26 @@
 #include "zend_API.h"
 #include "zend_interfaces.h"
 
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC)
+{
+       ALLOC_HASHTABLE(object->properties);
+       zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+
+       object->ce = ce;        
+       object->guards = NULL;
+}
+
+ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
+{
+       if (object->guards) {
+               zend_hash_destroy(object->guards);
+               FREE_HASHTABLE(object->guards);         
+       }
+       if (object->properties) {
+               zend_hash_destroy(object->properties);
+               FREE_HASHTABLE(object->properties);
+       }
+}
 
 ZEND_API void zend_objects_destroy_object(zend_object *object, 
zend_object_handle handle TSRMLS_DC)
 {
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_objects.h?r1=1.27&r2=1.28&diff_format=u
Index: ZendEngine2/zend_objects.h
diff -u ZendEngine2/zend_objects.h:1.27 ZendEngine2/zend_objects.h:1.28
--- ZendEngine2/zend_objects.h:1.27     Tue Feb 21 08:00:39 2006
+++ ZendEngine2/zend_objects.h  Wed Mar 29 15:08:51 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.h,v 1.27 2006/02/21 08:00:39 dmitry Exp $ */
+/* $Id: zend_objects.h,v 1.28 2006/03/29 15:08:51 tony2001 Exp $ */
 
 #ifndef ZEND_OBJECTS_H
 #define ZEND_OBJECTS_H
@@ -25,6 +25,8 @@
 #include "zend.h"
 
 BEGIN_EXTERN_C()
+ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce 
TSRMLS_DC);
+ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC);
 ZEND_API zend_object_value zend_objects_new(zend_object **object, 
zend_class_entry *class_type TSRMLS_DC);
 ZEND_API void zend_objects_destroy_object(zend_object *object, 
zend_object_handle handle TSRMLS_DC);
 ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/com_dotnet/com_persist.c?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/com_dotnet/com_persist.c
diff -u php-src/ext/com_dotnet/com_persist.c:1.8 
php-src/ext/com_dotnet/com_persist.c:1.9
--- php-src/ext/com_dotnet/com_persist.c:1.8    Sun Feb 19 00:55:19 2006
+++ php-src/ext/com_dotnet/com_persist.c        Wed Mar 29 15:08:51 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: com_persist.c,v 1.8 2006/02/19 00:55:19 andi Exp $ */
+/* $Id: com_persist.c,v 1.9 2006/03/29 15:08:51 tony2001 Exp $ */
 
 /* Infrastructure for working with persistent COM objects.
  * Implements: IStream* wrapper for PHP streams.
@@ -701,8 +701,7 @@
        if (object->unk) {
                IUnknown_Release(object->unk);
        }
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
        efree(object);
 }
 
@@ -715,9 +714,8 @@
        memcpy(clone, object, sizeof(*object));
        *clone_ptr = clone;
 
-       ALLOC_HASHTABLE(clone->std.properties);
-       zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-       
+       zend_object_std_init(&clone->std, object->std.ce TSRMLS_CC);
+
        if (clone->ipf) {
                IPersistFile_AddRef(clone->ipf);
        }
@@ -740,9 +738,7 @@
        helper = emalloc(sizeof(*helper));
        memset(helper, 0, sizeof(*helper));
 
-       ALLOC_HASHTABLE(helper->std.properties);
-       zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-       helper->std.ce = helper_ce;
+       zend_object_std_init(&helper->std, helper_ce TSRMLS_CC);
        
        retval.handle = zend_objects_store_put(helper, NULL, 
helper_free_storage, helper_clone TSRMLS_CC);
        retval.handlers = &helper_handlers;
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.c?r1=1.88&r2=1.89&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.88 php-src/ext/date/php_date.c:1.89
--- php-src/ext/date/php_date.c:1.88    Sat Mar 18 23:44:30 2006
+++ php-src/ext/date/php_date.c Wed Mar 29 15:08:51 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.88 2006/03/18 23:44:30 tony2001 Exp $ */
+/* $Id: php_date.c,v 1.89 2006/03/29 15:08:51 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1359,10 +1359,8 @@
 
        intern = emalloc(sizeof(php_date_obj));
        memset(intern, 0, sizeof(php_date_obj));
-       intern->std.ce = class_type;
        
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) date_object_free_storage_date, NULL 
TSRMLS_CC);
@@ -1379,10 +1377,8 @@
 
        intern = emalloc(sizeof(php_timezone_obj));
        memset(intern, 0, sizeof(php_timezone_obj));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL 
TSRMLS_CC);
@@ -1402,12 +1398,7 @@
                timelib_time_dtor(intern->time);
        }
 
-       if (intern->std.properties) {
-               zend_hash_destroy(intern->std.properties);
-               efree(intern->std.properties);
-               intern->std.properties = NULL;
-       }
-       
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        efree(object);
 }
 
@@ -1415,12 +1406,7 @@
 {
        php_timezone_obj *intern = (php_timezone_obj *)object;
 
-       if (intern->std.properties) {
-               zend_hash_destroy(intern->std.properties);
-               efree(intern->std.properties);
-               intern->std.properties = NULL;
-       }
-
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        efree(object);
 }
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/dom/php_dom.c?r1=1.92&r2=1.93&diff_format=u
Index: php-src/ext/dom/php_dom.c
diff -u php-src/ext/dom/php_dom.c:1.92 php-src/ext/dom/php_dom.c:1.93
--- php-src/ext/dom/php_dom.c:1.92      Sun Mar 26 00:23:37 2006
+++ php-src/ext/dom/php_dom.c   Wed Mar 29 15:08:52 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_dom.c,v 1.92 2006/03/26 00:23:37 tony2001 Exp $ */
+/* $Id: php_dom.c,v 1.93 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -934,8 +934,7 @@
 {
        dom_object *intern = (dom_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptr != NULL) {
                xmlXPathFreeContext((xmlXPathContextPtr) intern->ptr);
@@ -954,8 +953,7 @@
        dom_object *intern = (dom_object *)object;
        int retcount;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptr != NULL && ((php_libxml_node_ptr *)intern->ptr)->node 
!= NULL) {
                if (((xmlNodePtr) ((php_libxml_node_ptr 
*)intern->ptr)->node)->type != XML_DOCUMENT_NODE && ((xmlNodePtr) 
((php_libxml_node_ptr *)intern->ptr)->node)->type != XML_HTML_DOCUMENT_NODE) {
@@ -1001,8 +999,6 @@
        dom_object *intern;
 
        intern = emalloc(sizeof(dom_object));
-       intern->std.ce = class_type;
-       intern->std.guards = NULL;
        intern->ptr = NULL;
        intern->prop_handler = NULL;
        intern->document = NULL;
@@ -1014,8 +1010,7 @@
 
        zend_u_hash_find(UG(unicode)?&u_classes:&classes, 
UG(unicode)?IS_UNICODE:IS_STRING, base_class->name, base_class->name_length + 
1, (void **) &intern->prop_handler);
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        if (hash_copy) {
                zend_hash_copy(intern->std.properties, 
&class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) 
&tmp, sizeof(zval *));
        }
@@ -1120,8 +1115,7 @@
 
        php_libxml_decrement_doc_ref((php_libxml_node_object *)intern 
TSRMLS_CC);
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        efree(object);
 }
http://cvs.php.net/viewcvs.cgi/php-src/ext/mysqli/mysqli.c?r1=1.83&r2=1.84&diff_format=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.83 php-src/ext/mysqli/mysqli.c:1.84
--- php-src/ext/mysqli/mysqli.c:1.83    Wed Mar  8 00:43:28 2006
+++ php-src/ext/mysqli/mysqli.c Wed Mar 29 15:08:52 2006
@@ -15,7 +15,7 @@
   | Author: Georg Richter <[EMAIL PROTECTED]>                                |
   +----------------------------------------------------------------------+
 
-  $Id: mysqli.c,v 1.83 2006/03/08 00:43:28 pajoye Exp $ 
+  $Id: mysqli.c,v 1.84 2006/03/29 15:08:52 tony2001 Exp $ 
 */
 
 #ifdef HAVE_CONFIG_H
@@ -123,8 +123,9 @@
 static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
 {
        mysqli_object   *intern = (mysqli_object *)object;
-       
-       zend_objects_free_object_storage(&(intern->zo) TSRMLS_CC);
+
+       zend_object_std_dtor(&intern->zo TSRMLS_CC);
+       efree(intern);
 }
 /* }}} */
 
@@ -345,8 +346,6 @@
 
        intern = emalloc(sizeof(mysqli_object));
        memset(intern, 0, sizeof(mysqli_object));
-       intern->zo.ce = class_type;
-       intern->zo.guards = NULL;
        intern->ptr = NULL;
        intern->valid = 0;
        intern->prop_handler = NULL;
@@ -359,8 +358,7 @@
        zend_hash_find(&classes, mysqli_base_class->name.s, 
mysqli_base_class->name_length + 1, 
                                        (void **) &intern->prop_handler);
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref,
                                        (void *) &tmp, sizeof(zval *));
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.228&r2=1.229&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.228 
php-src/ext/reflection/php_reflection.c:1.229
--- php-src/ext/reflection/php_reflection.c:1.228       Sun Mar 12 15:34:46 2006
+++ php-src/ext/reflection/php_reflection.c     Wed Mar 29 15:08:52 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.228 2006/03/12 15:34:46 helly Exp $ */
+/* $Id: php_reflection.c,v 1.229 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -235,9 +235,7 @@
        reflection_object **intern_clone = (reflection_object **) object_clone;
 
        *intern_clone = emalloc(sizeof(reflection_object));
-       (*intern_clone)->zo.ce = intern->zo.ce;
-       (*intern_clone)->zo.guards = NULL;
-       ALLOC_HASHTABLE((*intern_clone)->zo.properties);
+       zend_object_std_init(&(*intern_clone)->zo, intern->zo.ce TSRMLS_CC);
        (*intern_clone)->ptr = intern->ptr;
        (*intern_clone)->free_ptr = intern->free_ptr;
        (*intern_clone)->obj = intern->obj;
@@ -253,14 +251,11 @@
        reflection_object *intern;
 
        intern = emalloc(sizeof(reflection_object));
-       intern->zo.ce = class_type;
-       intern->zo.guards = NULL;
        intern->ptr = NULL;
        intern->obj = NULL;
        intern->free_ptr = 0;
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_u_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0, 
UG(unicode));
+       zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
        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, NULL, 
reflection_free_objects_storage, reflection_objects_clone TSRMLS_CC);
        retval.handlers = &reflection_object_handlers;
@@ -4549,7 +4544,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.228 
2006/03/12 15:34:46 helly Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.229 
2006/03/29 15:08:52 tony2001 Exp $");
 
        php_info_print_table_end();
 } /* }}} */
http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.201&r2=1.202&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.201 
php-src/ext/simplexml/simplexml.c:1.202
--- php-src/ext/simplexml/simplexml.c:1.201     Thu Mar 16 10:33:23 2006
+++ php-src/ext/simplexml/simplexml.c   Wed Mar 29 15:08:52 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.201 2006/03/16 10:33:23 dmitry Exp $ */
+/* $Id: simplexml.c,v 1.202 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1752,9 +1752,8 @@
 
        sxe = (php_sxe_object *) object;
 
-       zend_hash_destroy(sxe->zo.properties);
-       FREE_HASHTABLE(sxe->zo.properties);
-
+       zend_object_std_dtor(&sxe->zo TSRMLS_CC);
+       
        php_libxml_node_decrement_resource((php_libxml_node_object *)sxe 
TSRMLS_CC);
 
        if (sxe->xpath) {
@@ -1777,14 +1776,12 @@
        php_sxe_object *intern;
 
        intern = ecalloc(1, sizeof(php_sxe_object));
-       intern->zo.ce = ce;
 
        intern->iter.type = SXE_ITER_NONE;
        intern->iter.nsprefix = NULL;
        intern->iter.name = NULL;
 
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->zo, ce TSRMLS_CC);
 
        return intern;
 }
@@ -2261,7 +2258,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.201 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.202 $");
        php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.103&r2=1.104&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.103 php-src/ext/spl/spl_array.c:1.104
--- php-src/ext/spl/spl_array.c:1.103   Thu Mar 23 11:42:41 2006
+++ php-src/ext/spl/spl_array.c Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.103 2006/03/23 11:42:41 dmitry Exp $ */
+/* $Id: spl_array.c,v 1.104 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -109,8 +109,7 @@
 {
        spl_array_object *intern = (spl_array_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        zval_ptr_dtor(&intern->array);
        zval_ptr_dtor(&intern->retval);
@@ -132,12 +131,10 @@
 
        intern = emalloc(sizeof(spl_array_object));
        memset(intern, 0, sizeof(spl_array_object));
-       intern->std.ce = class_type;
        *obj = intern;
        ALLOC_INIT_ZVAL(intern->retval);
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        intern->ar_flags = 0;
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.87&r2=1.88&diff_format=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.87 
php-src/ext/spl/spl_directory.c:1.88
--- php-src/ext/spl/spl_directory.c:1.87        Mon Mar 20 13:53:56 2006
+++ php-src/ext/spl/spl_directory.c     Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_directory.c,v 1.87 2006/03/20 13:53:56 tony2001 Exp $ */
+/* $Id: spl_directory.c,v 1.88 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -73,9 +73,9 @@
        if (intern->oth_handler && intern->oth_handler->dtor) {
                intern->oth_handler->dtor(intern TSRMLS_CC);
        }
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
-
+       
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
+       
        if (intern->path) {
                efree(intern->path);
        }
@@ -132,14 +132,12 @@
 
        intern = emalloc(sizeof(spl_filesystem_object));
        memset(intern, 0, sizeof(spl_filesystem_object));
-       intern->std.ce = class_type;
        /* intern->type = SPL_FS_INFO; done by set 0 */
        intern->file_class = spl_ce_SplFileObject;
        intern->info_class = spl_ce_SplFileInfo;
        if (obj) *obj = intern;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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) zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) spl_filesystem_object_free_storage, NULL 
TSRMLS_CC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.122&r2=1.123&diff_format=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.122 
php-src/ext/spl/spl_iterators.c:1.123
--- php-src/ext/spl/spl_iterators.c:1.122       Sun Mar 26 00:22:45 2006
+++ php-src/ext/spl/spl_iterators.c     Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_iterators.c,v 1.122 2006/03/26 00:22:45 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.123 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -687,8 +687,7 @@
                object->iterators = NULL;
        }
 
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
 
        efree(object);
 }
@@ -703,10 +702,8 @@
 
        intern = emalloc(sizeof(spl_recursive_it_object));
        memset(intern, 0, sizeof(spl_recursive_it_object));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) 
spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC);
@@ -1385,8 +1382,7 @@
        }
 #endif
 
-       zend_hash_destroy(object->std.properties);
-       FREE_HASHTABLE(object->std.properties);
+       zend_object_std_dtor(&object->std TSRMLS_CC);
 
        efree(object);
 }
@@ -1401,11 +1397,9 @@
 
        intern = emalloc(sizeof(spl_dual_it_object));
        memset(intern, 0, sizeof(spl_dual_it_object));
-       intern->std.ce = class_type;
        intern->dit_type = DIT_Unknown;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) spl_dual_it_free_storage, NULL TSRMLS_CC);
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_observer.c?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/spl/spl_observer.c
diff -u php-src/ext/spl/spl_observer.c:1.8 php-src/ext/spl/spl_observer.c:1.9
--- php-src/ext/spl/spl_observer.c:1.8  Sun Jan  1 13:09:54 2006
+++ php-src/ext/spl/spl_observer.c      Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_observer.c,v 1.8 2006/01/01 13:09:54 sniper Exp $ */
+/* $Id: spl_observer.c,v 1.9 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -85,9 +85,8 @@
 {
        spl_SplObjectStorage *intern = (spl_SplObjectStorage *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
-
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
+       
        zend_hash_destroy(&intern->storage);
 
        efree(object);
@@ -101,11 +100,9 @@
 
        intern = emalloc(sizeof(spl_SplObjectStorage));
        memset(intern, 0, sizeof(spl_SplObjectStorage));
-       intern->std.ce = class_type;
        *obj = intern;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        zend_hash_init(&intern->storage, 0, NULL, ZVAL_PTR_DTOR, 0);
http://cvs.php.net/viewcvs.cgi/php-src/ext/sqlite/sqlite.c?r1=1.188&r2=1.189&diff_format=u
Index: php-src/ext/sqlite/sqlite.c
diff -u php-src/ext/sqlite/sqlite.c:1.188 php-src/ext/sqlite/sqlite.c:1.189
--- php-src/ext/sqlite/sqlite.c:1.188   Thu Mar  2 13:12:45 2006
+++ php-src/ext/sqlite/sqlite.c Wed Mar 29 15:08:52 2006
@@ -17,7 +17,7 @@
    |          Marcus Boerger <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
 
-   $Id: sqlite.c,v 1.188 2006/03/02 13:12:45 dmitry Exp $
+   $Id: sqlite.c,v 1.189 2006/03/29 15:08:52 tony2001 Exp $
 */
 
 #ifdef HAVE_CONFIG_H
@@ -796,8 +796,7 @@
 {
        sqlite_object *intern = (sqlite_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->u.ptr) {
                if (intern->type == is_db) {
@@ -820,10 +819,8 @@
 
        intern = emalloc(sizeof(sqlite_object));
        memset(intern, 0, sizeof(sqlite_object));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL 
TSRMLS_CC);
@@ -1127,7 +1124,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "SQLite support", "enabled");
-       php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.188 2006/03/02 13:12:45 dmitry 
Exp $");
+       php_info_print_table_row(2, "PECL Module version", 
PHP_SQLITE_MODULE_VERSION " $Id: sqlite.c,v 1.189 2006/03/29 15:08:52 tony2001 
Exp $");
        php_info_print_table_row(2, "SQLite Library", sqlite_libversion());
        php_info_print_table_row(2, "SQLite Encoding", sqlite_libencoding());
        php_info_print_table_end();
http://cvs.php.net/viewcvs.cgi/php-src/ext/tidy/tidy.c?r1=1.77&r2=1.78&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.77 php-src/ext/tidy/tidy.c:1.78
--- php-src/ext/tidy/tidy.c:1.77        Thu Mar 23 14:22:40 2006
+++ php-src/ext/tidy/tidy.c     Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: tidy.c,v 1.77 2006/03/23 14:22:40 john Exp $ */
+/* $Id: tidy.c,v 1.78 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -530,8 +530,7 @@
 {
        PHPTidyObj *intern = (PHPTidyObj *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        if (intern->ptdoc) {
                intern->ptdoc->ref_count--;
@@ -555,10 +554,8 @@
 
        intern = emalloc(sizeof(PHPTidyObj));
        memset(intern, 0, sizeof(PHPTidyObj));
-       intern->std.ce = class_type;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
 
        switch(objtype) {
@@ -983,7 +980,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Tidy support", "enabled");
        php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.77 2006/03/23 14:22:40 john Exp $)");
+       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.78 2006/03/29 15:08:52 tony2001 Exp 
$)");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.28&r2=1.29&diff_format=u
Index: php-src/ext/xmlreader/php_xmlreader.c
diff -u php-src/ext/xmlreader/php_xmlreader.c:1.28 
php-src/ext/xmlreader/php_xmlreader.c:1.29
--- php-src/ext/xmlreader/php_xmlreader.c:1.28  Fri Mar 17 10:17:36 2006
+++ php-src/ext/xmlreader/php_xmlreader.c       Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xmlreader.c,v 1.28 2006/03/17 10:17:36 tony2001 Exp $ */
+/* $Id: php_xmlreader.c,v 1.29 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -378,8 +378,7 @@
 {
        xmlreader_object *intern = (xmlreader_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
        
        xmlreader_free_resources(intern);
 
@@ -396,13 +395,11 @@
 
        intern = emalloc(sizeof(xmlreader_object));
        memset(&intern->std, 0, sizeof(zend_object));
-       intern->std.ce = class_type;
        intern->ptr = NULL;
        intern->schema = NULL;
        intern->prop_handler = &xmlreader_prop_handlers;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.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)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) xmlreader_objects_free_storage, 
xmlreader_objects_clone TSRMLS_CC);
        intern->handle = retval.handle;
http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.31&r2=1.32&diff_format=u
Index: php-src/ext/xmlwriter/php_xmlwriter.c
diff -u php-src/ext/xmlwriter/php_xmlwriter.c:1.31 
php-src/ext/xmlwriter/php_xmlwriter.c:1.32
--- php-src/ext/xmlwriter/php_xmlwriter.c:1.31  Sun Feb 19 04:29:41 2006
+++ php-src/ext/xmlwriter/php_xmlwriter.c       Wed Mar 29 15:08:52 2006
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xmlwriter.c,v 1.31 2006/02/19 04:29:41 andi Exp $ */
+/* $Id: php_xmlwriter.c,v 1.32 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -80,11 +80,8 @@
                xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC);
        }
        intern->xmlwriter_ptr = NULL;
-       if (intern->zo.properties) {
-               zend_hash_destroy(intern->zo.properties);
-               FREE_HASHTABLE(intern->zo.properties);
-       }
-
+       zend_object_std_dtor(&intern->zo TSRMLS_CC);
+       
        efree(intern);
 }
 /* }}} */
@@ -99,11 +96,9 @@
 
        intern = emalloc(sizeof(ze_xmlwriter_object));
        memset(&intern->zo, 0, sizeof(zend_object));
-       intern->zo.ce = class_type;
        intern->xmlwriter_ptr = NULL;
        
-       ALLOC_HASHTABLE(intern->zo.properties);
-       zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->zo, class_type TSRMLS_CC);
        zend_hash_copy(intern->zo.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref,
                                        (void *) &tmp, sizeof(zval *));
 
http://cvs.php.net/viewcvs.cgi/php-src/ext/xsl/php_xsl.c?r1=1.37&r2=1.38&diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.37 php-src/ext/xsl/php_xsl.c:1.38
--- php-src/ext/xsl/php_xsl.c:1.37      Sun Jan  1 13:09:56 2006
+++ php-src/ext/xsl/php_xsl.c   Wed Mar 29 15:08:52 2006
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: php_xsl.c,v 1.37 2006/01/01 13:09:56 sniper Exp $ */
+/* $Id: php_xsl.c,v 1.38 2006/03/29 15:08:52 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -80,8 +80,7 @@
 {
        xsl_object *intern = (xsl_object *)object;
 
-       zend_hash_destroy(intern->std.properties);
-       FREE_HASHTABLE(intern->std.properties);
+       zend_object_std_dtor(&intern->std TSRMLS_CC);
 
        zend_hash_destroy(intern->parameter);
        FREE_HASHTABLE(intern->parameter);
@@ -119,8 +118,6 @@
        zval *tmp;
 
        intern = emalloc(sizeof(xsl_object));
-       intern->std.ce = class_type;
-       intern->std.guards = NULL;
        intern->ptr = NULL;
        intern->prop_handler = NULL;
        intern->parameter = NULL;
@@ -130,8 +127,7 @@
        intern->node_list = NULL;
        intern->doc = NULL;
 
-       ALLOC_HASHTABLE(intern->std.properties);
-       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_object_std_init(&intern->std, class_type TSRMLS_CC);
        zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
        ALLOC_HASHTABLE(intern->parameter);
        zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);

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

Reply via email to