rrichards Sun Aug 24 06:18:09 2003 EDT Modified files: /php-src/ext/xsl xsltprocessor.c php_xsl.h php_xsl.c Log: remove document pointer references as doc is now copied Index: php-src/ext/xsl/xsltprocessor.c diff -u php-src/ext/xsl/xsltprocessor.c:1.11 php-src/ext/xsl/xsltprocessor.c:1.12 --- php-src/ext/xsl/xsltprocessor.c:1.11 Wed Aug 20 13:58:55 2003 +++ php-src/ext/xsl/xsltprocessor.c Sun Aug 24 06:18:08 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xsltprocessor.c,v 1.11 2003/08/20 17:58:55 rrichards Exp $ */ +/* $Id: xsltprocessor.c,v 1.12 2003/08/24 10:18:08 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -144,6 +144,7 @@ sheetp = xsltParseStylesheetDoc(newdoc); if (!sheetp) { + xmlFreeDoc(newdoc); RETURN_FALSE; } @@ -153,21 +154,9 @@ if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { ((xsltStylesheetPtr) intern->ptr)->_private = NULL; } - if (intern->document != NULL) { - if (--intern->document->refcount == 0) { - xmlFreeDoc((xmlDocPtr) intern->document->ptr); - efree(intern->document); - } - ((xsltStylesheetPtr) intern->ptr)->doc = NULL; - intern->document = NULL; - } xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); intern->ptr = NULL; } - - intern->document = emalloc(sizeof(dom_ref_obj)); - intern->document->ptr = newdoc; - intern->document->refcount = 1; php_xsl_set_object(id, sheetp TSRMLS_CC); } Index: php-src/ext/xsl/php_xsl.h diff -u php-src/ext/xsl/php_xsl.h:1.3 php-src/ext/xsl/php_xsl.h:1.4 --- php-src/ext/xsl/php_xsl.h:1.3 Tue Jun 10 16:03:40 2003 +++ php-src/ext/xsl/php_xsl.h Sun Aug 24 06:18:08 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_xsl.h,v 1.3 2003/06/10 20:03:40 imajes Exp $ */ +/* $Id: php_xsl.h,v 1.4 2003/08/24 10:18:08 rrichards Exp $ */ #ifndef PHP_XSL_H #define PHP_XSL_H @@ -45,7 +45,6 @@ typedef struct _xsl_object { zend_object std; void *ptr; - dom_ref_obj *document; HashTable *prop_handler; zend_object_handle handle; HashTable *parameter; Index: php-src/ext/xsl/php_xsl.c diff -u php-src/ext/xsl/php_xsl.c:1.7 php-src/ext/xsl/php_xsl.c:1.8 --- php-src/ext/xsl/php_xsl.c:1.7 Mon Aug 18 21:30:27 2003 +++ php-src/ext/xsl/php_xsl.c Sun Aug 24 06:18:08 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_xsl.c,v 1.7 2003/08/19 01:30:27 wez Exp $ */ +/* $Id: php_xsl.c,v 1.8 2003/08/24 10:18:08 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -76,7 +76,6 @@ /* {{{ xsl_objects_dtor */ void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC) { - /* TODO */ xsl_object *intern = (xsl_object *)object; zend_hash_destroy(intern->std.properties); @@ -90,14 +89,6 @@ if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) { ((xsltStylesheetPtr) intern->ptr)->_private = NULL; } - if (intern->document != NULL) { - if (--intern->document->refcount == 0) { - xmlFreeDoc((xmlDocPtr) intern->document->ptr); - efree(intern->document); - } - ((xsltStylesheetPtr) intern->ptr)->doc = NULL; - intern->document = NULL; - } xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr); intern->ptr = NULL; @@ -119,7 +110,6 @@ intern->ptr = NULL; intern->prop_handler = NULL; intern->parameter = NULL; - intern->document = NULL; ALLOC_HASHTABLE(intern->std.properties); zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php