input: exit plugins in reverse mode (help shared database states)
@@ -344,7 +344,7 @@ void flb_input_exit_all(struct flb_config *config)
struct flb_input_plugin *p;
/* Iterate instances */
- mk_list_foreach_safe(head, tmp, &config->inputs) {
+ mk_list_foreach_safe_r(head, tmp, &config->inputs) {
in = mk_list_entry(head, struct flb_input_instance, _head);
p = in->p;
if (!p) {
