From 802968443e3ccb6f897ece87d894837881ee869c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 5 Dec 2002 12:44:21 +0000 Subject: [PATCH] Fix aggregation with ZE2 in PHP4.3\n#I will not MFB it since aggregation should move to ZEndEngine --- ext/standard/aggregation.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ext/standard/aggregation.c b/ext/standard/aggregation.c index 63f4063015..58a9518b82 100644 --- a/ext/standard/aggregation.c +++ b/ext/standard/aggregation.c @@ -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); @@ -394,6 +385,9 @@ static void aggregate(INTERNAL_FUNCTION_PARAMETERS, int aggr_what, int aggr_type 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; new_ce->clone = Z_OBJCE_P(obj)->clone; -- 2.50.1