mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Cleanup php_libxml_unregister_node()
This commit is contained in:
parent
6e8b134023
commit
a54d63aefe
1 changed files with 3 additions and 5 deletions
|
@ -151,18 +151,16 @@ static void php_libxml_unlink_entity(void *data, void *table, xmlChar *name)
|
||||||
/* {{{ internal functions for interoperability */
|
/* {{{ internal functions for interoperability */
|
||||||
static void php_libxml_unregister_node(xmlNodePtr nodep)
|
static void php_libxml_unregister_node(xmlNodePtr nodep)
|
||||||
{
|
{
|
||||||
php_libxml_node_object *wrapper;
|
|
||||||
|
|
||||||
php_libxml_node_ptr *nodeptr = nodep->_private;
|
php_libxml_node_ptr *nodeptr = nodep->_private;
|
||||||
|
|
||||||
if (nodeptr != NULL) {
|
if (nodeptr != NULL) {
|
||||||
wrapper = nodeptr->_private;
|
php_libxml_node_object *wrapper = nodeptr->_private;
|
||||||
if (wrapper) {
|
if (wrapper) {
|
||||||
php_libxml_decrement_node_ptr(wrapper);
|
php_libxml_decrement_node_ptr(wrapper);
|
||||||
php_libxml_decrement_doc_ref(wrapper);
|
php_libxml_decrement_doc_ref(wrapper);
|
||||||
} else {
|
} else {
|
||||||
if (nodeptr->node != NULL && nodeptr->node->type != XML_DOCUMENT_NODE) {
|
if (nodep->type != XML_DOCUMENT_NODE) {
|
||||||
nodeptr->node->_private = NULL;
|
nodep->_private = NULL;
|
||||||
}
|
}
|
||||||
nodeptr->node = NULL;
|
nodeptr->node = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue