summaryrefslogtreecommitdiff
path: root/cel
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2014-01-03 22:00:42 +0000
committerKevin Harwell <kharwell@digium.com>2014-01-03 22:00:42 +0000
commit2f62394fb5bd099e534f4a7df2fd939e972868d5 (patch)
tree939129fc018aa43ecec47763cc2a550c1b12c2ee /cel
parentf8b55f16d27fe8152b8ce576ef9db73c497b00c8 (diff)
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 ........ Merged revisions 404858 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 404859 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cel')
-rw-r--r--cel/cel_pgsql.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c
index 8db85d721..ceaa34e79 100644
--- a/cel/cel_pgsql.c
+++ b/cel/cel_pgsql.c
@@ -557,6 +557,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);
@@ -575,7 +579,6 @@ static int load_module(void)
static int reload(void)
{
- my_unload_module();
return my_load_module(1);
}