Changeset 92
- Timestamp:
- 05/10/05 20:46:29 (3 years ago)
- Files:
-
- eaccelerator/trunk/eaccelerator.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/eaccelerator.c
r90 r92 115 115 116 116 FILE *F_fp; 117 118 /* pointer to the properties_info hashtable destructor */ 119 static dtor_func_t properties_info_dtor = NULL; 117 120 118 121 /* saved original functions */ … … 2391 2394 } 2392 2395 2393 /* is equal to zend_destroy_property_info in zend_compile.c, this function is2394 * needed as destructor for the properties_info hashtable, but is declared2395 * static, so redefine it here. */2396 static void destroy_property_info(zend_property_info *property_info) {2397 efree(property_info->name);2398 }2399 2400 2396 static zend_class_entry* restore_class_entry(zend_class_entry* to, eaccelerator_class_entry *from TSRMLS_DC) 2401 2397 { … … 2536 2532 to->default_properties.pDestructor = ZVAL_PTR_DTOR; 2537 2533 restore_hash(&to->properties_info, &from->properties_info, (restore_bucket_t)restore_property_info TSRMLS_CC); 2538 to->properties_info.pDestructor = (dtor_func_t) destroy_property_info;2534 to->properties_info.pDestructor = properties_info_dtor; 2539 2535 if (from->static_members != NULL) { 2540 2536 ALLOC_HASHTABLE(to->static_members); … … 3744 3740 } 3745 3741 3742 /* This function creates a dummy class entry to steal the pointer to the 3743 * properties_info hashtable destructor because it's declared static */ 3744 static dtor_func_t get_zend_destroy_property_info(TSRMLS_D) { 3745 zend_class_entry dummy_class_entry; 3746 dummy_class_entry.type = ZEND_USER_CLASS; 3747 3748 zend_initialize_class_data(&dummy_class_entry, 1 TSRMLS_CC); 3749 3750 dtor_func_t property_dtor = dummy_class_entry.properties_info.pDestructor; 3751 3752 zend_hash_destroy(&dummy_class_entry.default_properties); 3753 zend_hash_destroy(&dummy_class_entry.properties_info); 3754 zend_hash_destroy(dummy_class_entry.static_members); 3755 zend_hash_destroy(&dummy_class_entry.function_table); 3756 FREE_HASHTABLE(dummy_class_entry.static_members); 3757 zend_hash_destroy(&dummy_class_entry.constants_table); 3758 3759 return property_dtor; 3760 } 3761 3746 3762 PHP_MINIT_FUNCTION(eaccelerator) { 3747 3763 if (type == MODULE_PERSISTENT) { … … 3832 3848 register_eaccelerator_as_zend_extension(); 3833 3849 } 3850 3851 /* cache the properties_info destructor */ 3852 properties_info_dtor = get_zend_destroy_property_info(TSRMLS_C); 3853 3834 3854 return SUCCESS; 3835 3855 }