From: Sebastian Harl Date: Sun, 20 Apr 2014 18:20:07 +0000 (+0200) Subject: plugin: Unset the plugin context before unregistering a plugin. X-Git-Tag: sysdb-0.1.0~113 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=6abb7d25d62ad7ad0fe3ca2242290553584c757f plugin: Unset the plugin context before unregistering a plugin. Else, the context is still considered to be in use and, thus, won't be removed from the global plugin (context) list. --- diff --git a/src/core/plugin.c b/src/core/plugin.c index 188c7db..fe8844a 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -809,10 +809,12 @@ sdb_plugin_init_all(void) if (callback(cb->cb_user_data)) { sdb_log(SDB_LOG_ERR, "core: Failed to initialize plugin " "'%s'. Unregistering all callbacks.", obj->name); + ctx_set(old_ctx); plugin_unregister_by_name(cb->cb_ctx->info.plugin_name); ++ret; } - ctx_set(old_ctx); + else + ctx_set(old_ctx); } sdb_llist_iter_destroy(iter); return ret;