From: Kevin Harwell Date: Fri, 3 Jan 2014 21:58:17 +0000 (+0000) Subject: cel_pgsql: module not correctly reloading X-Git-Tag: 11.8.0-rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b7d8e4df45c2ef81ccaefabcbbc60a6bca5104f;p=thirdparty%2Fasterisk.git cel_pgsql: module not correctly reloading Upon reload the module unconditionally "unloaded" the module (freeing memory and setting pointers to NULL) and then when attempting a "load" if the config file had not changed then nothing would be reinitialized. By moving the "unload" to occur conditionally (reload only) after an attempted configuration load, but before module "loading" alleviates the issue. The module now loads/unloads/reloads correctly. (closes issue ASTERISK-22871) Reported by: Matteo ........ Merged revisions 404857 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@404858 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c index 614a377e4d..536838b16d 100644 --- a/cel/cel_pgsql.c +++ b/cel/cel_pgsql.c @@ -559,6 +559,10 @@ static int my_load_module(int reload) return AST_MODULE_LOAD_SUCCESS; } + if (reload) { + my_unload_module(); + } + process_my_load_module(cfg); ast_config_destroy(cfg); @@ -579,7 +583,6 @@ static int load_module(void) static int reload(void) { - my_unload_module(); return my_load_module(1); }