From 6abb7d25d62ad7ad0fe3ca2242290553584c757f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 20 Apr 2014 20:20:07 +0200 Subject: [PATCH] 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. --- src/core/plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2