remove document pointer references as doc is now copied

This commit is contained in:
Rob Richards 2003-08-24 10:18:08 +00:00
parent 38805f2809
commit ea1b33438a
3 changed files with 1 additions and 23 deletions

View File

@ -76,7 +76,6 @@ void xsl_objects_clone(void *object, void **object_clone TSRMLS_DC)
/* {{{ 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 @@ void xsl_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
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 @@ zend_object_value xsl_objects_new(zend_class_entry *class_type TSRMLS_DC)
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);

View File

@ -45,7 +45,6 @@ extern zend_module_entry xsl_module_entry;
typedef struct _xsl_object {
zend_object std;
void *ptr;
dom_ref_obj *document;
HashTable *prop_handler;
zend_object_handle handle;
HashTable *parameter;

View File

@ -144,6 +144,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
sheetp = xsltParseStylesheetDoc(newdoc);
if (!sheetp) {
xmlFreeDoc(newdoc);
RETURN_FALSE;
}
@ -153,22 +154,10 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
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);
}
/* }}} end xsl_xsltprocessor_import_stylesheet */