MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXIncludeFreeContext

Function xmlXIncludeFreeContext

ThirdParty/libxml2/vtklibxml2/xinclude.c:267–296  ·  view source on GitHub ↗

* xmlXIncludeFreeContext: * @ctxt: the XInclude context * * Free an XInclude context */

Source from the content-addressed store, hash-verified

265 * Free an XInclude context
266 */
267void
268xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) {
269 int i;
270
271 if (ctxt == NULL)
272 return;
273 if (ctxt->urlTab != NULL) {
274 for (i = 0; i < ctxt->urlNr; i++) {
275 xmlFreeDoc(ctxt->urlTab[i].doc);
276 xmlFree(ctxt->urlTab[i].url);
277 }
278 xmlFree(ctxt->urlTab);
279 }
280 for (i = 0;i < ctxt->incNr;i++) {
281 if (ctxt->incTab[i] != NULL)
282 xmlXIncludeFreeRef(ctxt->incTab[i]);
283 }
284 if (ctxt->incTab != NULL)
285 xmlFree(ctxt->incTab);
286 if (ctxt->txtTab != NULL) {
287 for (i = 0;i < ctxt->txtNr;i++) {
288 xmlFree(ctxt->txtTab[i].text);
289 xmlFree(ctxt->txtTab[i].url);
290 }
291 xmlFree(ctxt->txtTab);
292 }
293 if (ctxt->xpctxt != NULL)
294 xmlXPathFreeContext(ctxt->xpctxt);
295 xmlFree(ctxt);
296}
297
298/**
299 * xmlXIncludeParseFile:

Callers 5

xmlFreeTextReaderFunction · 0.85
xmlTextReaderSetupFunction · 0.85
errParseTestFunction · 0.85

Calls 3

xmlFreeDocFunction · 0.85
xmlXIncludeFreeRefFunction · 0.85
xmlXPathFreeContextFunction · 0.85

Tested by 1

errParseTestFunction · 0.68