aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/plugin_loader.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-07-15 14:05:02 +0200
committerMartin Willi <martin@revosec.ch>2010-08-04 09:26:20 +0200
commitcd251d9a21da963a52b0337f4e4182360de62875 (patch)
treee00673890a54d4a65fc4fe8eca41c19d2f87b9ba /src/libstrongswan/plugins/plugin_loader.c
parent3479c2793116b18407e2e041e5bee454a8f9005d (diff)
downloadstrongswan-cd251d9a21da963a52b0337f4e4182360de62875.tar.bz2
strongswan-cd251d9a21da963a52b0337f4e4182360de62875.tar.xz
Unload plugins in reverse order
Diffstat (limited to 'src/libstrongswan/plugins/plugin_loader.c')
-rw-r--r--src/libstrongswan/plugins/plugin_loader.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c
index 336d0bc02..e1427bf15 100644
--- a/src/libstrongswan/plugins/plugin_loader.c
+++ b/src/libstrongswan/plugins/plugin_loader.c
@@ -189,7 +189,6 @@ static bool load(private_plugin_loader_t *this, char *path, char *list)
plugin = load_plugin(this, path, token);
if (plugin)
{
- /* insert in front to destroy them in reverse order */
this->plugins->insert_last(this->plugins, plugin);
this->names->insert_last(this->names, token);
}
@@ -215,12 +214,13 @@ static void unload(private_plugin_loader_t *this)
plugin_t *plugin;
char *name;
- while (this->plugins->remove_first(this->plugins,
+ /* unload plugins in reverse order */
+ while (this->plugins->remove_last(this->plugins,
(void**)&plugin) == SUCCESS)
{
plugin->destroy(plugin);
}
- while (this->names->remove_first(this->names, (void**)&name) == SUCCESS)
+ while (this->names->remove_last(this->names, (void**)&name) == SUCCESS)
{
free(name);
}