+Sat Jul 12 20:35:28 HKT 2003 William Brack <wbrack@mmm.com.hk>
+
+ * fixed bug 114764, trouble with globals and RVT's
+ with minor changes in variables.c and transform.c
+ so that any global instantiated with an RVT gets
+ uninitialized when the RVT is destroyed.
+
Thu Jul 10 15:47:33 CEST 2003 Daniel Veillard <daniel@veillard.com>
* libxslt/transform.c: simple cast missing Peter Breitenlohner
templPop(ctxt);
/*
* Free up all the unreferenced RVT
+ * Also set any global variables instantiated
+ * using them, to be "not yet computed".
*/
if (ctxt->tmpRVT != NULL) {
+ xsltStackElemPtr elem;
xmlDocPtr tmp = ctxt->tmpRVT, next;
-
while (tmp != NULL) {
+ elem = (xsltStackElemPtr)tmp->_private;
+ if (elem != NULL) {
+ elem->computed = 0;
+ xmlXPathFreeObject(elem->value);
+ }
next = (xmlDocPtr) tmp->next;
xmlFreeDoc(tmp);
tmp = next;
xsltGenericDebug(xsltGenericDebugContext,
"xsltCopy: namespace declaration\n");
#endif
- xsltCopyNamespace(ctxt, ctxt->insert, (xmlNsPtr) node);
+ xsltCopyNamespace(ctxt, ctxt->insert, (xmlNsPtr)node);
break;
default:
break;
* Result Value Tree interfaces *
* *
************************************************************************/
-
/**
* xsltCreateRVT:
* @ctxt: an XSLT transformation context
* Tag the subtree for removal once consumed
*/
xsltRegisterTmpRVT(ctxt, container);
-
oldoutput = ctxt->output;
ctxt->output = container;
oldInsert = ctxt->insert;
* Tag the subtree for removal once consumed
*/
xsltRegisterTmpRVT(ctxt, container);
-
+ /*
+ * Save a pointer to the global variable for later cleanup
+ */
+ container->_private = elem;
oldoutput = ctxt->output;
ctxt->output = container;
oldInsert = ctxt->insert;