[Broker] Fix auth plugin cleanup function not being called.

Closes #900.

Thanks to Julian Zhao.

Signed-off-by: Roger A. Light <roger@atchoo.org>
This commit is contained in:
Roger A. Light
2018-08-01 15:53:29 +01:00
parent ebf4d3a920
commit 8bbb5887d0
2 changed files with 22 additions and 0 deletions
+8
View File
@@ -1,3 +1,11 @@
1.5.1 - 2018xxxx
================
Broker:
- Fix plugin cleanup function not being called on exit of the broker.
Closes #900.
1.5 - 20180502
==============
+14
View File
@@ -282,6 +282,20 @@ static void security__module_cleanup_single(struct mosquitto__security_options *
int i;
for(i=0; i<opts->auth_plugin_config_count; i++){
/* Run plugin cleanup function */
if(opts->auth_plugin_configs[i].plugin.version == 3){
opts->auth_plugin_configs[i].plugin.plugin_cleanup_v3(
opts->auth_plugin_configs[i].plugin.user_data,
opts->auth_plugin_configs[i].options,
opts->auth_plugin_configs[i].option_count);
}else if(opts->auth_plugin_configs[i].plugin.version == 2){
opts->auth_plugin_configs[i].plugin.plugin_cleanup_v2(
opts->auth_plugin_configs[i].plugin.user_data,
(struct mosquitto_auth_opt *)opts->auth_plugin_configs[i].options,
opts->auth_plugin_configs[i].option_count);
}
if(opts->auth_plugin_configs[i].plugin.lib){
LIB_CLOSE(opts->auth_plugin_configs[i].plugin.lib);
}