Merge branch 'pull/collectd-4.0' into collectd-4.0
[collectd.git] / src / plugin.c
index 8087950..fe7a9e5 100644 (file)
@@ -133,7 +133,6 @@ static int plugin_load_file (char *file)
                const char *error = lt_dlerror ();
 
                ERROR ("lt_dlopen failed: %s", error);
-               DEBUG ("lt_dlopen failed: %s", error);
                return (1);
        }
 
@@ -607,6 +606,11 @@ void plugin_shutdown_all (void)
        while (le != NULL)
        {
                callback = (int (*) (void)) le->value;
+
+               /* Advance the pointer before calling the callback allows
+                * shutdown functions to unregister themselves. If done the
+                * other way around the memory `le' points to will be freed
+                * after callback returns. */
                le = le->next;
 
                (*callback) ();