helly Thu Dec 5 07:44:21 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard aggregation.c Log: Fix aggregation with ZE2 in PHP4.3\n#I will not MFB it since aggregation should move to ZEndEngine Index: php4/ext/standard/aggregation.c diff -u php4/ext/standard/aggregation.c:1.11 php4/ext/standard/aggregation.c:1.11.4.1 --- php4/ext/standard/aggregation.c:1.11 Fri Aug 23 21:19:27 2002 +++ php4/ext/standard/aggregation.c Thu Dec 5 07:44:21 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: aggregation.c,v 1.11 2002/08/24 01:19:27 helly Exp $ */ +/* $Id: aggregation.c,v 1.11.4.1 2002/12/05 12:44:21 helly Exp $ */ #include "php.h" #include "basic_functions.h" @@ -27,20 +27,11 @@ static void aggregation_info_dtor(aggregation_info *info) { - /* FIXME: This is here to make it compile with Engine 2 but part of this module will need rewriting */ - #ifndef ZEND_ENGINE_2 destroy_zend_class(info->new_ce); efree(info->new_ce); #else - /* FIXME: In ZE2, there seems to be an issue with refcounts or something between - * this class entry and the original; there are problems when destroying the - * function table. - * Skipping deleting here will prevent a segfault but will leak - * the class name, the static_members hash and the ce itself. - * */ - - /* destroy_zend_class(&info->new_ce); */ + destroy_zend_class(&info->new_ce); #endif zval_ptr_dtor(&info->aggr_members); @@ -393,6 +384,9 @@ zend_hash_init(&new_ce->private_properties, 10, NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(&new_ce->private_properties, &Z_OBJCE_P(obj)->private_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + + zend_hash_init(&new_ce->protected_properties, 10, NULL, ZVAL_PTR_DTOR, +0); + zend_hash_copy(&new_ce->protected_properties, +&Z_OBJCE_P(obj)->protected_properties, (copy_ctor_func_t) zval_add_ref, (void *) +&tmp, sizeof(zval *)); new_ce->constructor = Z_OBJCE_P(obj)->constructor; new_ce->destructor = Z_OBJCE_P(obj)->destructor;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php