void fmi1_xml_free_model_description(fmi1_xml_model_description_t* md) { jm_callbacks* cb; if(!md) return; cb = md->callbacks; fmi1_xml_clear_model_description(md); cb->free(md); }
void fmi1_xml_parse_free_context(fmi1_xml_parser_context_t *context) { if(!context) return; if(context->modelDescription) fmi1_xml_clear_model_description(context->modelDescription); if(context->parser) { XML_ParserFree(context->parser); context->parser = 0; } fmi1_xml_free_parse_buffer(context); if(context->attrMap) { jm_vector_free(jm_named_ptr)(context->attrMap); context->attrMap = 0; } if(context->elmMap) { jm_vector_free(fmi1_xml_element_handle_map_t)(context->elmMap); context->elmMap = 0; } if(context->attrBuffer) { jm_vector_free(jm_string)(context->attrBuffer); context->attrBuffer = 0; } jm_stack_free_data(int)(& context->elmStack ); jm_vector_free_data(char)( &context->elmData ); jm_vector_free_data(jm_voidp)(&context->directDependencyBuf); jm_vector_foreach(jm_string)(&context->directDependencyStringsStore, (void(*)(jm_string))context->callbacks->free); jm_vector_free_data(jm_string)(&context->directDependencyStringsStore); context->callbacks->free(context); }