X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=graph_list.c;fp=graph_list.c;h=c9fbbaba72d72c011bd398520ce5bb0b7a7b8d7b;hb=4732be36d1fd60fe5047ffe1e2d903403d691a8b;hp=3edcb3284ca468a4df8b844e51e74ca56295f410;hpb=964b6bdd9fc86ed17e00e01abbe423166326b45d;p=collection4.git diff --git a/graph_list.c b/graph_list.c index 3edcb32..c9fbbab 100644 --- a/graph_list.c +++ b/graph_list.c @@ -599,10 +599,25 @@ static int gl_instance_get_rrdargs_cb (graph_def_t *def, void *user_data) /* {{{ return (0); } /* }}} int gl_instance_get_rrdargs_cb */ +static int gl_clear_instances (void) /* {{{ */ +{ + graph_config_t *cfg; + + for (cfg = graph_config_head; cfg != NULL; cfg = cfg->next) + { + instance_destroy (cfg->instances); + cfg->instances = NULL; + } + + return (0); +} /* }}} int gl_clear_instances */ + + /* * Config functions */ -static int config_get_string (const oconfig_item_t *ci, char **ret_str) +static int config_get_string (const oconfig_item_t *ci, /* {{{ */ + char **ret_str) { char *tmp; @@ -622,7 +637,7 @@ static int config_get_string (const oconfig_item_t *ci, char **ret_str) /* * Global functions */ -int graph_config_add (const oconfig_item_t *ci) +int graph_config_add (const oconfig_item_t *ci) /* {{{ */ { char *host = NULL; char *plugin = NULL; @@ -949,8 +964,6 @@ graph_ident_t *gl_instance_get_selector (graph_instance_t *inst) /* {{{ */ return (ident_clone (inst->select)); } /* }}} graph_ident_t *gl_instance_get_selector */ -/* DELETEME */ - int gl_update (void) /* {{{ */ { time_t now; @@ -975,6 +988,7 @@ int gl_update (void) /* {{{ */ gl.type = NULL; gl.type_instance = NULL; + gl_clear_instances (); status = foreach_host (callback_host, &gl); gl_last_update = now;