mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 09:14:17 +01:00
cleanup: plugin unload
* reduce code duplication
This commit is contained in:
parent
3050d5e80e
commit
06a8412b16
1 changed files with 11 additions and 18 deletions
|
@ -1263,23 +1263,16 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
|
|||
remove_status_vars(show_vars);
|
||||
}
|
||||
|
||||
if (plugin_type_deinitialize[plugin->plugin->type])
|
||||
{
|
||||
if ((*plugin_type_deinitialize[plugin->plugin->type])(plugin))
|
||||
plugin_type_init deinit= plugin_type_deinitialize[plugin->plugin->type];
|
||||
if (!deinit)
|
||||
deinit= (plugin_type_init)(plugin->plugin->deinit);
|
||||
|
||||
if (deinit && deinit(plugin))
|
||||
{
|
||||
sql_print_error("Plugin '%s' of type %s failed deinitialization",
|
||||
plugin->name.str, plugin_type_names[plugin->plugin->type].str);
|
||||
}
|
||||
}
|
||||
else if (plugin->plugin->deinit)
|
||||
{
|
||||
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
|
||||
if (plugin->plugin->deinit(plugin))
|
||||
{
|
||||
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
|
||||
plugin->name.str));
|
||||
}
|
||||
}
|
||||
|
||||
plugin->state= PLUGIN_IS_UNINITIALIZED;
|
||||
|
||||
if (ref_check && plugin->ref_count)
|
||||
|
|
Loading…
Add table
Reference in a new issue