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

Function xmlFreeTextReader

ThirdParty/libxml2/vtklibxml2/xmlreader.c:2185–2244  ·  view source on GitHub ↗

* xmlFreeTextReader: * @reader: the xmlTextReaderPtr * * Deallocate all the resources associated to the reader */

Source from the content-addressed store, hash-verified

2183 * Deallocate all the resources associated to the reader
2184 */
2185void
2186xmlFreeTextReader(xmlTextReaderPtr reader) {
2187 if (reader == NULL)
2188 return;
2189#ifdef LIBXML_SCHEMAS_ENABLED
2190 if (reader->rngSchemas != NULL) {
2191 xmlRelaxNGFree(reader->rngSchemas);
2192 reader->rngSchemas = NULL;
2193 }
2194 if (reader->rngValidCtxt != NULL) {
2195 if (! reader->rngPreserveCtxt)
2196 xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt);
2197 reader->rngValidCtxt = NULL;
2198 }
2199 if (reader->xsdPlug != NULL) {
2200 xmlSchemaSAXUnplug(reader->xsdPlug);
2201 reader->xsdPlug = NULL;
2202 }
2203 if (reader->xsdValidCtxt != NULL) {
2204 if (! reader->xsdPreserveCtxt)
2205 xmlSchemaFreeValidCtxt(reader->xsdValidCtxt);
2206 reader->xsdValidCtxt = NULL;
2207 }
2208 if (reader->xsdSchemas != NULL) {
2209 xmlSchemaFree(reader->xsdSchemas);
2210 reader->xsdSchemas = NULL;
2211 }
2212#endif
2213#ifdef LIBXML_XINCLUDE_ENABLED
2214 if (reader->xincctxt != NULL)
2215 xmlXIncludeFreeContext(reader->xincctxt);
2216#endif
2217#ifdef LIBXML_PATTERN_ENABLED
2218 if (reader->patternTab != NULL) {
2219 int i;
2220 for (i = 0;i < reader->patternNr;i++) {
2221 if (reader->patternTab[i] != NULL)
2222 xmlFreePattern(reader->patternTab[i]);
2223 }
2224 xmlFree(reader->patternTab);
2225 }
2226#endif
2227 if (reader->mode != XML_TEXTREADER_MODE_CLOSED)
2228 xmlTextReaderClose(reader);
2229 if (reader->ctxt != NULL) {
2230 if (reader->dict == reader->ctxt->dict)
2231 reader->dict = NULL;
2232 if (reader->allocs & XML_TEXTREADER_CTXT)
2233 xmlFreeParserCtxt(reader->ctxt);
2234 }
2235 if (reader->sax != NULL)
2236 xmlFree(reader->sax);
2237 if (reader->buffer != NULL)
2238 xmlBufFree(reader->buffer);
2239 if (reader->entTab != NULL)
2240 xmlFree(reader->entTab);
2241 if (reader->dict != NULL)
2242 xmlDictFree(reader->dict);

Callers 11

streamFileFunction · 0.85
walkDocFunction · 0.85
xmlReaderForFileFunction · 0.85
xmlReaderForMemoryFunction · 0.85
xmlReaderForFdFunction · 0.85
xmlReaderForIOFunction · 0.85
streamParseTestFunction · 0.85
walkerParseTestFunction · 0.85
streamMemParseTestFunction · 0.85
rngStreamTestFunction · 0.85
patternTestFunction · 0.85

Calls 11

xmlRelaxNGFreeFunction · 0.85
xmlRelaxNGFreeValidCtxtFunction · 0.85
xmlSchemaSAXUnplugFunction · 0.85
xmlSchemaFreeValidCtxtFunction · 0.85
xmlSchemaFreeFunction · 0.85
xmlXIncludeFreeContextFunction · 0.85
xmlFreePatternFunction · 0.85
xmlTextReaderCloseFunction · 0.85
xmlFreeParserCtxtFunction · 0.85
xmlBufFreeFunction · 0.85
xmlDictFreeFunction · 0.85

Tested by 5

streamParseTestFunction · 0.68
walkerParseTestFunction · 0.68
streamMemParseTestFunction · 0.68
rngStreamTestFunction · 0.68
patternTestFunction · 0.68