From e658842761f3d2443ca547379e054c95ca308378 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 14 Nov 2005 21:52:27 +0000 Subject: [PATCH] fix #35197 (Destructor is not called) and similar issues in other extensions --- ext/dom/php_dom.c | 4 ++-- ext/spl/spl_array.c | 2 +- ext/spl/spl_iterators.c | 4 ++-- ext/spl/spl_observer.c | 2 +- ext/sqlite/sqlite.c | 2 +- ext/tidy/tidy.c | 2 +- ext/xmlreader/php_xmlreader.c | 2 +- ext/xsl/php_xsl.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 58c18df620..af3ce66665 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1001,7 +1001,7 @@ zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC) intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC); + retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC); intern->handle = retval.handle; retval.handlers = dom_get_obj_handlers(TSRMLS_C); @@ -1018,7 +1018,7 @@ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC) intern = dom_objects_set_class(class_type, 1 TSRMLS_CC); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC); + retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC); intern->handle = retval.handle; retval.handlers = dom_get_obj_handlers(TSRMLS_C); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index d428699f2a..c768b10284 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -146,7 +146,7 @@ static zend_object_value spl_array_object_new_ex(zend_class_entry *class_type, s intern->ar_flags &= ~SPL_ARRAY_IS_REF; } - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_array_object_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) spl_array_object_free_storage, NULL TSRMLS_CC); while (parent) { if (parent == U_CLASS_ENTRY(spl_ce_ArrayIterator)) { retval.handlers = &spl_handler_ArrayIterator; diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index c4bb5872bf..298c36eaba 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -701,7 +701,7 @@ static zend_object_value spl_RecursiveIteratorIterator_new(zend_class_entry *cla zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); 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, NULL, (zend_objects_free_object_storage_t) spl_RecursiveIteratorIterator_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) spl_RecursiveIteratorIterator_free_storage, NULL TSRMLS_CC); retval.handlers = &spl_handlers_rec_it_it; return retval; } @@ -1375,7 +1375,7 @@ static zend_object_value spl_dual_it_new(zend_class_entry *class_type TSRMLS_DC) zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); 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, NULL, (zend_objects_free_object_storage_t) spl_dual_it_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) spl_dual_it_free_storage, NULL TSRMLS_CC); retval.handlers = &spl_handlers_dual_it; return retval; } diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index aa8e602a57..13ea1c8663 100755 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -110,7 +110,7 @@ static zend_object_value spl_object_storage_new_ex(zend_class_entry *class_type, zend_hash_init(&intern->storage, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) spl_SplOjectStorage_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) spl_SplOjectStorage_free_storage, NULL TSRMLS_CC); retval.handlers = &spl_handler_SplObjectStorage; return retval; } diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c index 427819c147..5ecb0263e8 100644 --- a/ext/sqlite/sqlite.c +++ b/ext/sqlite/sqlite.c @@ -831,7 +831,7 @@ static void sqlite_object_new(zend_class_entry *class_type, zend_object_handlers zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); 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, NULL, (zend_objects_free_object_storage_t) sqlite_object_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) sqlite_object_free_storage, NULL TSRMLS_CC); retval->handlers = handlers; } diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 9b0e33bbe9..24fb87f1e3 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -598,7 +598,7 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers * break; } - retval->handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) tidy_object_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) tidy_object_free_storage, NULL TSRMLS_CC); retval->handlers = handlers; } diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 9a02147ce0..18b9a6249e 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -362,7 +362,7 @@ zend_object_value xmlreader_objects_new(zend_class_entry *class_type TSRMLS_DC) ALLOC_HASHTABLE(intern->std.properties); zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); 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, NULL, (zend_objects_free_object_storage_t) xmlreader_objects_free_storage, xmlreader_objects_clone TSRMLS_CC); + 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; retval.handlers = &xmlreader_object_handlers; return retval; diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 8ea0f83053..ed29cbb382 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -138,7 +138,7 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC) zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0); ALLOC_HASHTABLE(intern->registered_phpfunctions); zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t) xsl_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) xsl_objects_free_storage, NULL TSRMLS_CC); intern->handle = retval.handle; retval.handlers = &xsl_object_handlers; return retval; -- 2.40.0