const char *error = lt_dlerror ();
ERROR ("lt_dlopen failed: %s", error);
- DEBUG ("lt_dlopen failed: %s", error);
return (1);
}
while (le != NULL)
{
callback = (int (*) (void)) le->value;
- (*callback) ();
+ /* 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) ();
}
} /* void plugin_shutdown_all */