> Important note: Unregistering the shutdown callback during shutdown is
> somewhat tricky. Doing that frees the llist_t entry in plugin.c:list_shutdown.
> This might cause a segfault in plugin_shutdown_all () when it tries to access
> the next pointer of that entry. If plugin_unregister_shutdown () is the last
> statement before the return from the shutdown callback this should be save in
> about 99% of all cases. Still there should be some better way to handle this.
This is an imho nice way to fix it.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
while (le != NULL)
{
callback = (int (*) (void)) le->value;
- (*callback) ();
-
le = le->next;
+
+ (*callback) ();
}
} /* void plugin_shutdown_all */