summaryrefslogtreecommitdiff
path: root/ext/dom/php_dom.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-16 16:57:05 +0200
committerNikita Popov <nikic@php.net>2014-04-16 17:14:34 +0200
commit59f6d189c8c6a2a11574b5b4ce98e0e8b6a7bc0b (patch)
tree5267e39554697460850865247c8878412a9088a6 /ext/dom/php_dom.c
parent39d12294fd2483c4634c16fb54cfe5d8e3356ecf (diff)
downloadphp-git-59f6d189c8c6a2a11574b5b4ce98e0e8b6a7bc0b.tar.gz
Fix remaining XPath issue
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r--ext/dom/php_dom.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index a15cd255b7..c584ef39b7 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -842,7 +842,7 @@ PHP_MINIT_FUNCTION(dom)
#if defined(LIBXML_XPATH_ENABLED)
memcpy(&dom_xpath_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers));
- dom_xpath_object_handlers.offset = XtOffsetOf(dom_xpath_object, std);
+ dom_xpath_object_handlers.offset = XtOffsetOf(dom_xpath_object, dom) + XtOffsetOf(dom_object, std);
dom_xpath_object_handlers.free_obj = dom_xpath_objects_free_storage;
INIT_CLASS_ENTRY(ce, "DOMXPath", php_dom_xpath_class_functions);
@@ -1011,12 +1011,11 @@ void dom_xpath_objects_free_storage(zend_object *object TSRMLS_DC)
{
dom_xpath_object *intern = php_xpath_obj_from_obj(object);
- zend_object_std_dtor(&intern->std TSRMLS_CC);
+ zend_object_std_dtor(&intern->dom.std TSRMLS_CC);
- if (intern->ptr != NULL) {
- xmlXPathFreeContext((xmlXPathContextPtr) intern->ptr);
- php_libxml_decrement_doc_ref((php_libxml_node_object *) intern TSRMLS_CC);
- intern->ptr = NULL;
+ if (intern->dom.ptr != NULL) {
+ xmlXPathFreeContext((xmlXPathContextPtr) intern->dom.ptr);
+ php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom TSRMLS_CC);
}
if (intern->registered_phpfunctions) {
@@ -1143,13 +1142,13 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
ALLOC_HASHTABLE(intern->registered_phpfunctions);
zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0);
- intern->prop_handler = &dom_xpath_prop_handlers;
- intern->std.handlers = &dom_xpath_object_handlers;
+ intern->dom.prop_handler = &dom_xpath_prop_handlers;
+ intern->dom.std.handlers = &dom_xpath_object_handlers;
- zend_object_std_init(&intern->std, class_type TSRMLS_CC);
- object_properties_init(&intern->std, class_type);
+ zend_object_std_init(&intern->dom.std, class_type TSRMLS_CC);
+ object_properties_init(&intern->dom.std, class_type);
- return &intern->std;
+ return &intern->dom.std;
}
/* }}} */
#endif