mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
remove document pointer references as doc is now copied
This commit is contained in:
parent
38805f2809
commit
ea1b33438a
3 changed files with 1 additions and 23 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue