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

Function xmlFreeDoc

ThirdParty/libxml2/vtklibxml2/tree.c:1136–1181  ·  view source on GitHub ↗

* xmlFreeDoc: * @cur: pointer to the document * * Free a document including all children and associated DTDs. */

Source from the content-addressed store, hash-verified

1134 * Free a document including all children and associated DTDs.
1135 */
1136void
1137xmlFreeDoc(xmlDocPtr cur) {
1138 xmlDtdPtr extSubset, intSubset;
1139 xmlDictPtr dict = NULL;
1140
1141 if (cur == NULL) {
1142 return;
1143 }
1144
1145 dict = cur->dict;
1146
1147 if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
1148 xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
1149
1150 /*
1151 * Do this before freeing the children list to avoid ID lookups
1152 */
1153 if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
1154 cur->ids = NULL;
1155 if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
1156 cur->refs = NULL;
1157 extSubset = cur->extSubset;
1158 intSubset = cur->intSubset;
1159 if (intSubset == extSubset)
1160 extSubset = NULL;
1161 if (extSubset != NULL) {
1162 xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
1163 cur->extSubset = NULL;
1164 xmlFreeDtd(extSubset);
1165 }
1166 if (intSubset != NULL) {
1167 xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
1168 cur->intSubset = NULL;
1169 xmlFreeDtd(intSubset);
1170 }
1171
1172 if (cur->children != NULL) xmlFreeNodeList(cur->children);
1173 if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
1174
1175 DICT_FREE(cur->version)
1176 DICT_FREE(cur->name)
1177 DICT_FREE(cur->encoding)
1178 DICT_FREE(cur->URL)
1179 xmlFree(cur);
1180 if (dict) xmlDictFree(dict);
1181}
1182
1183/**
1184 * xmlNodeParseContentInternal:

Callers 15

RequestDataMethod · 0.85
~XdmfWriterMethod · 0.85
closeFileMethod · 0.85
xmlDumpXMLCatalogFunction · 0.85
xmlParseCatalogFileFunction · 0.85
xmlParseXMLCatalogFileFunction · 0.85
testSAXFunction · 0.85
parseFileFunction · 0.85
parseAndPrintFileFunction · 0.85
xmlconfTestInvalidFunction · 0.85
xmlconfTestValidFunction · 0.85
xmlconfTestNotNSWFFunction · 0.85

Calls 7

xmlFreeIDTableFunction · 0.85
xmlFreeRefTableFunction · 0.85
xmlUnlinkNodeInternalFunction · 0.85
xmlFreeDtdFunction · 0.85
xmlFreeNodeListFunction · 0.85
xmlFreeNsListFunction · 0.85
xmlDictFreeFunction · 0.85

Tested by 15

saxParseTestFunction · 0.68
oldParseTestFunction · 0.68
pushParseTestFunction · 0.68
pushBoundaryTestFunction · 0.68
memParseTestFunction · 0.68
noentParseTestFunction · 0.68
errParseTestFunction · 0.68
fdParseTestFunction · 0.68
walkerParseTestFunction · 0.68
xpathDocTestFunction · 0.68
xptrDocTestFunction · 0.68
xmlidDocTestFunction · 0.68