[asterisk-commits] kharwell: trunk r404860 - in /trunk: ./ cel/cel_pgsql.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 3 16:00:44 CST 2014


Author: kharwell
Date: Fri Jan  3 16:00:42 2014
New Revision: 404860

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

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

Modified:
    trunk/   (props changed)
    trunk/cel/cel_pgsql.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Jan  3 16:00:42 2014
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403778,403781-404568,404581,404592,404605,404613,404652,404663,404676,404725,404737,404764,404781,404786,404843,404855
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-403290,403292-403778,403781-404568,404581,404592,404605,404613,404652,404663,404676,404725,404737,404764,404781,404786,404843,404855,404859

Modified: trunk/cel/cel_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_pgsql.c?view=diff&rev=404860&r1=404859&r2=404860
==============================================================================
--- trunk/cel/cel_pgsql.c (original)
+++ trunk/cel/cel_pgsql.c Fri Jan  3 16:00:42 2014
@@ -557,6 +557,10 @@
 		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 reload(void)
 {
-	my_unload_module();
 	return my_load_module(1);
 }
 




More information about the asterisk-commits mailing list