summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 402f6df)
raw | patch | inline | side by side (parent: 402f6df)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 20 May 2007 20:59:21 +0000 (22:59 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 21 May 2007 05:17:48 +0000 (07:17 +0200) |
> 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>
> 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>
src/plugin.c | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 36cd80af61e7a9c9976465e9fdedd8928e4895c8..8087950ea85987a76b1f750c2a449e2fa5b27899 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
while (le != NULL)
{
callback = (int (*) (void)) le->value;
- (*callback) ();
-
le = le->next;
+
+ (*callback) ();
}
} /* void plugin_shutdown_all */