* xmlFreeProp: * @cur: an attribute * * Free an attribute including all children. */
| 1918 | * Free an attribute including all children. |
| 1919 | */ |
| 1920 | void |
| 1921 | xmlFreeProp(xmlAttrPtr cur) { |
| 1922 | xmlDictPtr dict = NULL; |
| 1923 | if (cur == NULL) return; |
| 1924 | |
| 1925 | if (cur->doc != NULL) dict = cur->doc->dict; |
| 1926 | |
| 1927 | if ((__xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue)) |
| 1928 | xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); |
| 1929 | |
| 1930 | /* Check for ID removal -> leading to invalid references ! */ |
| 1931 | if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) { |
| 1932 | xmlRemoveID(cur->doc, cur); |
| 1933 | } |
| 1934 | if (cur->children != NULL) xmlFreeNodeList(cur->children); |
| 1935 | DICT_FREE(cur->name) |
| 1936 | xmlFree(cur); |
| 1937 | } |
| 1938 | |
| 1939 | /** |
| 1940 | * xmlRemoveProp: |
no test coverage detected