--- mqtt/src/dl.c 2012/05/08 14:27:46 1.2.2.6 +++ mqtt/src/dl.c 2012/06/01 11:39:15 1.2.2.7 @@ -2,8 +2,6 @@ #include "rtlm.h" -static void *acc_rtlm, *pub_rtlm, *log_rtlm; - struct tagCallbacks call; @@ -74,7 +72,6 @@ mqttLoadRTLM(cfg_root_t *cfg, int modtype) switch (modtype) { case 0: - acc_rtlm = rtlm; call.OpenACC = mqttOpenRTLM; call.CloseACC = mqttCloseRTLM; call.LoginACC = dlsym(rtlm, "mqtt_rtlm_login"); @@ -85,7 +82,6 @@ mqttLoadRTLM(cfg_root_t *cfg, int modtype) } break; case 1: - pub_rtlm = rtlm; call.OpenPUB = mqttOpenRTLM; call.ClosePUB = mqttCloseRTLM; call.InitSessPUB = dlsym(rtlm, "mqtt_rtlm_init_session"); @@ -108,7 +104,6 @@ mqttLoadRTLM(cfg_root_t *cfg, int modtype) } break; default: - log_rtlm = rtlm; call.OpenLOG = mqttOpenRTLM; call.CloseLOG = mqttCloseRTLM; call.LOG = dlsym(rtlm, "mqtt_rtlm_logger"); @@ -124,19 +119,10 @@ mqttLoadRTLM(cfg_root_t *cfg, int modtype) } void -mqttUnloadRTLM(int modtype) +mqttUnloadRTLM(void *rtlm) { - switch (modtype) { - case 0: - dlclose(acc_rtlm); - break; - case 1: - dlclose(pub_rtlm); - break; - default: - dlclose(log_rtlm); - break; - } + if (rtlm) + dlclose(rtlm); } inline int