[asterisk-commits] bbryant: branch 1.8 r305603 - /branches/1.8/cel/cel_pgsql.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 1 13:23:24 CST 2011
Author: bbryant
Date: Tue Feb 1 13:23:20 2011
New Revision: 305603
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305603
Log:
Add a possible solution to a customer problem with reloading cel_pgsql.so
quickly.
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=305603&r1=305602&r2=305603
==============================================================================
--- branches/1.8/cel/cel_pgsql.c (original)
+++ branches/1.8/cel/cel_pgsql.c Tue Feb 1 13:23:20 2011
@@ -337,31 +337,39 @@
static int my_unload_module(void)
{
struct columns *current;
+ AST_RWLIST_WRLOCK(&psql_columns);
if (event_sub) {
event_sub = ast_event_unsubscribe(event_sub);
+ event_sub = NULL;
}
if (conn) {
PQfinish(conn);
+ conn = NULL;
}
if (pghostname) {
ast_free(pghostname);
+ pghostname = NULL;
}
if (pgdbname) {
ast_free(pgdbname);
+ pgdbname = NULL;
}
if (pgdbuser) {
ast_free(pgdbuser);
+ pgdbuser = NULL;
}
if (pgpassword) {
ast_free(pgpassword);
+ pgpassword = NULL;
}
if (pgdbport) {
ast_free(pgdbport);
+ pgdbport = NULL;
}
if (table) {
ast_free(table);
- }
- AST_RWLIST_WRLOCK(&psql_columns);
+ table = NULL;
+ }
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
ast_free(current);
}
More information about the asterisk-commits
mailing list