diff options
Diffstat (limited to 'ext/xmlwriter/php_xmlwriter.c')
-rw-r--r-- | ext/xmlwriter/php_xmlwriter.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index d80afa148..72c035bd9 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_xmlwriter.c,v 1.20.2.9 2006/01/01 12:50:16 sniper Exp $ */ +/* $Id: php_xmlwriter.c,v 1.20.2.12 2006/04/03 14:59:30 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -77,10 +77,20 @@ static void xmlwriter_object_free_storage(void *object TSRMLS_DC) xmlwriter_free_resource_ptr(intern->xmlwriter_ptr TSRMLS_CC); } intern->xmlwriter_ptr = NULL; + +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) + zend_object_std_dtor(&intern->zo TSRMLS_CC); +#else + if (intern->zo.guards) { + zend_hash_destroy(intern->zo.guards); + FREE_HASHTABLE(intern->zo.guards); + } + if (intern->zo.properties) { zend_hash_destroy(intern->zo.properties); FREE_HASHTABLE(intern->zo.properties); } +#endif efree(intern); } @@ -96,11 +106,18 @@ PHP_XMLWRITER_API zend_object_value xmlwriter_object_new(zend_class_entry *class intern = emalloc(sizeof(ze_xmlwriter_object)); memset(&intern->zo, 0, sizeof(zend_object)); - intern->zo.ce = class_type; intern->xmlwriter_ptr = NULL; - + +#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1 && PHP_RELEASE_VERSION > 2) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 1) || (PHP_MAJOR_VERSION > 5) + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); +#else ALLOC_HASHTABLE(intern->zo.properties); zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0); + + intern->zo.ce = class_type; + intern->zo.guards = NULL; +#endif + zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); @@ -1615,7 +1632,7 @@ PHP_FUNCTION(xmlwriter_open_uri) #ifdef ZEND_ENGINE_2 zval *this = getThis(); - ze_xmlwriter_object *ze_obj; + ze_xmlwriter_object *ze_obj = NULL; #endif #ifndef ZEND_ENGINE_2 @@ -1694,7 +1711,7 @@ PHP_FUNCTION(xmlwriter_open_memory) #ifdef ZEND_ENGINE_2 zval *this = getThis(); - ze_xmlwriter_object *ze_obj; + ze_xmlwriter_object *ze_obj = NULL; #endif #ifdef ZEND_ENGINE_2 |