conf: splitted function config_param_free()
This commit is contained in:
parent
1b227e0145
commit
f3739a73af
15
src/conf.c
15
src/conf.c
@ -142,10 +142,8 @@ config_new_param(const char *value, int line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_param_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
config_param_free(struct config_param *param)
|
||||||
{
|
{
|
||||||
struct config_param *param = data;
|
|
||||||
|
|
||||||
g_free(param->value);
|
g_free(param->value);
|
||||||
|
|
||||||
for (unsigned i = 0; i < param->num_block_params; i++) {
|
for (unsigned i = 0; i < param->num_block_params; i++) {
|
||||||
@ -159,6 +157,14 @@ config_param_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
|||||||
g_free(param);
|
g_free(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
config_param_free_callback(gpointer data, G_GNUC_UNUSED gpointer user_data)
|
||||||
|
{
|
||||||
|
struct config_param *param = data;
|
||||||
|
|
||||||
|
config_param_free(param);
|
||||||
|
}
|
||||||
|
|
||||||
static struct config_entry *
|
static struct config_entry *
|
||||||
config_entry_get(const char *name)
|
config_entry_get(const char *name)
|
||||||
{
|
{
|
||||||
@ -176,7 +182,8 @@ void config_global_finish(void)
|
|||||||
for (unsigned i = 0; i < G_N_ELEMENTS(config_entries); ++i) {
|
for (unsigned i = 0; i < G_N_ELEMENTS(config_entries); ++i) {
|
||||||
struct config_entry *entry = &config_entries[i];
|
struct config_entry *entry = &config_entries[i];
|
||||||
|
|
||||||
g_slist_foreach(entry->params, config_param_free, NULL);
|
g_slist_foreach(entry->params,
|
||||||
|
config_param_free_callback, NULL);
|
||||||
g_slist_free(entry->params);
|
g_slist_free(entry->params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user