]> granicus.if.org Git - php/commitdiff
remove document pointer references as doc is now copied
authorRob Richards <rrichards@php.net>
Sun, 24 Aug 2003 10:18:08 +0000 (10:18 +0000)
committerRob Richards <rrichards@php.net>
Sun, 24 Aug 2003 10:18:08 +0000 (10:18 +0000)
ext/xsl/php_xsl.c
ext/xsl/php_xsl.h
ext/xsl/xsltprocessor.c

index b5e44c0e44ae503047fc6d5b135bc13290fda8b6..742192b9b2a68b288a6bcf6091b749fbfcd315a6 100644 (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);
index e22874311a378933bf2382d21b37d5efc3b7619c..c7c4151de229d9ab5cd50597bc7953c6541a06b6 100644 (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;
index 27d22fef0571e86382365e6da5bdb4eafed98e06..403a370634f6c71f433e294a385defdf3518d487 100644 (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 */