]> granicus.if.org Git - php/commitdiff
- Fix bug in XML extension which exists due to a not perfect work around
authorAndi Gutmans <andi@php.net>
Sat, 29 Dec 2001 18:10:01 +0000 (18:10 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 29 Dec 2001 18:10:01 +0000 (18:10 +0000)
- with ZE1. In ZE2 the correct code seems to work well.

ext/xml/xml.c

index f523ba819b7188d864d9059376e35a5397c3f5c4..1647a4f317bf0292d5f5ff60c598d3dd3c8c1140 100644 (file)
@@ -289,11 +289,12 @@ static void xml_parser_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        xml_parser *parser = (xml_parser *)rsrc->ptr;
 
-       /* please leave this commented - or ask thies@thieso.net before doing it (again) 
+       /* please leave this commented - or ask thies@thieso.net before doing it (again) */
+#ifdef ZEND_ENGINE_2
        if (parser->object) {
                zval_ptr_dtor(&parser->object);
        }
-       */
+#endif
        
        if (parser->parser) {
                XML_ParserFree(parser->parser);
@@ -1126,17 +1127,19 @@ PHP_FUNCTION(xml_set_object)
 
        ZEND_FETCH_RESOURCE(parser,xml_parser *,pind, -1, "XML Parser", le_xml_parser);
 
-       /* please leave this commented - or ask thies@thieso.net before doing it (again) 
+       /* please leave this commented - or ask thies@thieso.net before doing it (again) */
+#ifdef ZEND_ENGINE_2
        if (parser->object) {
                zval_ptr_dtor(&parser->object);
        }
-       */
+#endif
        
        parser->object = *mythis;
 
-       /* please leave this commented - or ask thies@thieso.net before doing it (again) 
+       /* please leave this commented - or ask thies@thieso.net before doing it (again) */
+#ifdef ZEND_ENGINE_2
        zval_add_ref(&parser->object); 
-       */
+#endif
 
        RETVAL_TRUE;
 }