plugin.c: Added a comment that explains why the order of the linked list and callback...
authorFlorian Forster <octo@huhu.verplant.org>
Mon, 21 May 2007 05:21:28 +0000 (07:21 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Mon, 21 May 2007 05:21:28 +0000 (07:21 +0200)
src/plugin.c

index 8087950..da66204 100644 (file)
@@ -607,6 +607,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) ();