From a148878752a614c697041cc5f27b3175cb331ae7 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Tue, 3 Jun 2003 19:36:20 +0000 Subject: god bless valgrind. fix double free where object is prematurely dtor'd. I should probably convert the simplexml nodes over to this system too. Actually the new dom extension and everywhere else should use the same type of methods.. :) --- ext/simplexml/php_simplexml.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext/simplexml/php_simplexml.h') diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h index e3a754baa3..b57ad28ce6 100644 --- a/ext/simplexml/php_simplexml.h +++ b/ext/simplexml/php_simplexml.h @@ -51,14 +51,21 @@ PHP_RINIT_FUNCTION(simplexml); PHP_RSHUTDOWN_FUNCTION(simplexml); PHP_MINFO_FUNCTION(simplexml); +typedef struct { + void *ptr; + int refcount; +} simplexml_ref_obj; + typedef struct { zend_object zo; - xmlDocPtr document; + xmlHashTablePtr nsmap; + simplexml_ref_obj *document; xmlXPathContextPtr xpath; xmlNodePtr node; } php_sxe_object; + #ifdef ZTS #define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v) #else -- cgit v1.2.1