--- libaitcfg/src/aitcfg.c 2012/07/22 21:54:47 1.6 +++ libaitcfg/src/aitcfg.c 2012/07/25 15:24:20 1.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitcfg.c,v 1.6 2012/07/22 21:54:47 misho Exp $ +* $Id: aitcfg.c,v 1.7 2012/07/25 15:24:20 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -154,13 +154,13 @@ cfgLoadConfig(const char *cfgName, cfg_root_t * __rest } /* - * cfgUnloadConfig() - Unload config from memory and free resources + * cfgClearConfig() - Clear config and free resources * * @cfg = Config root * return: none */ void -cfgUnloadConfig(cfg_root_t * __restrict cfg) +cfgClearConfig(cfg_root_t * __restrict cfg) { struct tagCfg *av; @@ -178,7 +178,21 @@ cfgUnloadConfig(cfg_root_t * __restrict cfg) } cfg->rbh_root = NULL; CFG_RC_UNLOCK(cfg); +} +/* + * cfgUnloadConfig() - Unload config from memory and destroy resources + * + * @cfg = Config root + * return: none + */ +void +cfgUnloadConfig(cfg_root_t * __restrict cfg) +{ + if (!cfg) + return; + + cfgClearConfig(cfg); pthread_mutex_destroy(&cfg->rc_mtx); }