1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Added cleanup routines, cleanup with -pedantic on linux, closed #3788, Daniel

This commit is contained in:
Daniel Veillard
1999-11-24 18:04:22 +00:00
parent 11a48ec6f4
commit a819dace56
27 changed files with 597 additions and 501 deletions

View File

@ -431,6 +431,29 @@ xmlInitCharEncodingHandlers(void) {
#endif
}
/**
* xmlCleanupCharEncodingHandlers:
*
* Cleanup the memory allocated for the char encoding support, it
* unregisters all the encoding handlers.
*/
void
xmlCleanupCharEncodingHandlers(void) {
if (handlers == NULL) return;
for (;nbCharEncodingHandler > 0;) {
nbCharEncodingHandler--;
if (handlers[nbCharEncodingHandler] != NULL) {
xmlFree(handlers[nbCharEncodingHandler]->name);
xmlFree(handlers[nbCharEncodingHandler]);
}
}
xmlFree(handlers);
handlers = NULL;
nbCharEncodingHandler = 0;
xmlDefaultCharEncodingHandler = NULL;
}
/**
* xmlRegisterCharEncodingHandler:
* @handler: the xmlCharEncodingHandlerPtr handler block