00001 00012 #define GITK_LIB_C 00013 #define GITK_DONE_C 00014 00015 #include "gitkincludes.h" 00016 00023 void gitk_done(void) { 00024 gitk_log_intro(); 00025 00026 //-- detach and free all global callbacks 00027 if(gitk_global_callback_list) { 00028 GList* node=g_list_first(gitk_global_callback_list); 00029 GitkCallbackNodePtr callback_node; 00030 while(node) { 00031 callback_node=(GitkCallbackNodePtr)node->data; 00032 g_free(callback_node->widget_id); 00033 g_free(callback_node->callback_name); 00034 g_free(callback_node); 00035 node=g_list_next(node); 00036 } 00037 g_list_free(gitk_global_callback_list); 00038 } 00039 //-- iterate over dialog list and hide + free all dialog 00040 if(gitk_dialog_list) { 00041 GList* node=g_list_first(gitk_dialog_list); 00042 GitkDialogPtr dialog; 00043 00044 while(node) { 00045 dialog=(GitkDialogPtr)node->data; 00046 gitk_dialog_hide(dialog); 00048 gitk_dialog_free(dialog); 00049 node=g_list_next(node); 00050 } 00051 g_list_free(gitk_dialog_list); 00052 gitk_dialog_list=NULL; 00053 } 00054 00055 //-- free libxslt 00056 xsltCleanupGlobals(); 00057 //-- free stylesheets 00058 gitk_done_xsl(); 00059 00060 //-- free compiled xpath expressions 00061 gitk_done_common_xpath_expressions(); 00062 //-- free static data of libxml2 00063 xmlCleanupParser(); 00064 //-- reset the error handler (there seems to be no way to reset it for libxslt and it not really matters) 00065 //initGenericErrorDefaultFunc(NULL); 00066 00067 //-- free the renderer plugin (if there was one active) 00068 gitk_renderer_done(); 00069 00070 free(gitk_renderer_name);gitk_renderer_name=NULL; 00071 free(gitk_style_name);gitk_style_name=NULL; 00072 00073 gitk_profile_done(); 00074 00075 gitk_initialized=FALSE; 00076 00077 gitk_log_outro(); 00078 } 00079 00084 void gitk_done_common_xpath_expressions(void) { 00085 if(xpath_get_dialog_name) { xmlXPathFreeCompExpr(xpath_get_dialog_name);xpath_get_dialog_name=NULL; } 00086 if(xpath_get_dialog_modality) { xmlXPathFreeCompExpr(xpath_get_dialog_modality);xpath_get_dialog_modality=NULL; } 00087 if(xpath_get_label) { xmlXPathFreeCompExpr(xpath_get_label);xpath_get_label=NULL; } 00088 } 00089 00094 void gitk_done_xsl(void) { 00095 if(xsl_style) { xsltFreeStylesheet(xsl_style);xsl_style=NULL; } 00096 if(xsl_domain) { xsltFreeStylesheet(xsl_domain);xsl_domain=NULL; } 00097 if(xsl_expand) { xsltFreeStylesheet(xsl_expand);xsl_expand=NULL; } 00098 if(xsl_i18n) { xsltFreeStylesheet(xsl_i18n);xsl_i18n=NULL; } 00099 xsltUnregisterExtModule(I18N_NS_URL); 00100 } 00101 00105 void gitk_exit_func(void) { 00106 //-- free the renderer plugin (if there was one active) 00107 gitk_renderer_done(); 00108 gitk_initialized=FALSE; 00109 } 00110