static void __main_clean(int keeppid) { if (g_c == NULL) return; job_cleanup(); ly_db_close(); ly_clc_ip_clean(); ly_entity_store_destroy(); ly_epoll_close(); if (keeppid == 0) lyutil_remove_pid_file(g_c->pid_path, PROGRAM_NAME); if (g_c->conf_path) free(g_c->conf_path); if (g_c->log_path) free(g_c->log_path); if (g_c->db_name) free(g_c->db_name); if (g_c->db_user) free(g_c->db_user); if (g_c->db_pass) free(g_c->db_pass); if (g_c->clc_ip) free(g_c->clc_ip); if (g_c->clc_mcast_ip) free(g_c->clc_mcast_ip); if (g_c->clc_data_dir) free(g_c->clc_data_dir); lyxml_cleanup(); logclose(); free(g_c); return; }
static void __main_clean(int keeppid) { if (g_c == NULL) return; NodeConfig *c = &g_c->config; NodeSysConfig *s = &g_c->config_sys; ly_epoll_close(); libvirt_close(); if (keeppid == 0) lyutil_remove_pid_file(c->pid_path, PROGRAM_NAME); lyauth_free(&g_c->auth); if (c->clc_ip) free(c->clc_ip); if (c->clc_mcast_ip) free(c->clc_mcast_ip); if (c->conf_path) free(c->conf_path); if (c->sysconf_path) free(c->sysconf_path); if (c->node_data_dir) free(c->node_data_dir); if (c->ins_data_dir) free(c->ins_data_dir); if (c->app_data_dir) free(c->app_data_dir); if (c->log_path) free(c->log_path); if (s->clc_ip) free(s->clc_ip); if (s->node_secret) free(s->node_secret); if (g_c->clc_ip) free(g_c->clc_ip); if (g_c->node_ip) free(g_c->node_ip); if (g_c->node) { luoyun_node_info_cleanup(g_c->node); free(g_c->node); } free(g_c); logclose(); lyxml_cleanup(); return; }