tool_main: Moved OperateConfig cleanup into main_free()

This commit is contained in:
Steve Holme 2014-02-23 13:44:59 +00:00
parent d6b9f054e9
commit 665096e24c
1 changed files with 9 additions and 9 deletions

View File

@ -161,11 +161,17 @@ static CURLcode main_init(struct GlobalConfig *config)
* This is the main global destructor for the app. Call this after * This is the main global destructor for the app. Call this after
* _all_ libcurl usage is done. * _all_ libcurl usage is done.
*/ */
static void main_free(void) static void main_free(struct GlobalConfig *config)
{ {
/* Main cleanup */
curl_global_cleanup(); curl_global_cleanup();
convert_cleanup(); convert_cleanup();
metalink_cleanup(); metalink_cleanup();
/* Free the config structures */
config_free(config->first);
config->first = NULL;
config->last = NULL;
} }
/* /*
@ -193,19 +199,13 @@ int main(int argc, char *argv[])
/* Start our curl operation */ /* Start our curl operation */
result = operate(global.first, argc, argv); result = operate(global.first, argc, argv);
/* Perform the main cleanup */
main_free();
}
if(global.first) {
#ifdef __SYMBIAN32__ #ifdef __SYMBIAN32__
if(global->first->showerror) if(global->first->showerror)
tool_pressanykey(); tool_pressanykey();
#endif #endif
/* Free the config structures */ /* Perform the main cleanup */
config_free(global.first); main_free(&global);
global.first = NULL;
} }
#ifdef __NOVELL_LIBC__ #ifdef __NOVELL_LIBC__