Allow plugins to provide an error message. Useful for reporting problems

when registering the plugins.
This commit is contained in:
Jan Vidar Krey
2010-07-29 08:41:26 +02:00
parent 920d696ff5
commit 97feb3635e
4 changed files with 45 additions and 27 deletions

View File

@@ -826,22 +826,12 @@ void hub_plugins_load(struct hub_info* hub)
void hub_plugins_unload(struct hub_info* hub)
{
if (!hub->plugins || !hub->plugins->loaded)
if (hub->plugins)
{
return;
plugin_shutdown(hub->plugins);
hub_free(hub->plugins);
hub->plugins = 0;
}
struct uhub_plugin_handle* plugin = (struct uhub_plugin_handle*) list_get_first(hub->plugins->loaded);
while (plugin)
{
plugin_unload(plugin);
plugin = (struct uhub_plugin_handle*) list_get_next(hub->plugins->loaded);
}
list_destroy(hub->plugins->loaded);
hub_free(hub->plugins->plugin_dir);
hub_free(hub->plugins);
hub->plugins = 0;
}
#endif