[asterisk-commits] kharwell: branch 1.8 r404857 - /branches/1.8/cel/cel_pgsql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 3 15:57:13 CST 2014


Author: kharwell
Date: Fri Jan  3 15:57:11 2014
New Revision: 404857

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404857
Log:
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


Modified:
    branches/1.8/cel/cel_pgsql.c

Modified: branches/1.8/cel/cel_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cel/cel_pgsql.c?view=diff&rev=404857&r1=404856&r2=404857
==============================================================================
--- branches/1.8/cel/cel_pgsql.c (original)
+++ branches/1.8/cel/cel_pgsql.c Fri Jan  3 15:57:11 2014
@@ -542,6 +542,10 @@
 		return AST_MODULE_LOAD_SUCCESS;
 	}
 
+	if (reload) {
+		my_unload_module();
+	}
+
 	process_my_load_module(cfg);
 	ast_config_destroy(cfg);
 
@@ -562,7 +566,6 @@
 
 static int reload(void)
 {
-	my_unload_module();
 	return my_load_module(1);
 }
 




More information about the asterisk-commits mailing list