summaryrefslogtreecommitdiff
path: root/cel
diff options
context:
space:
mode:
authorBrett Bryant <bbryant@digium.com>2011-02-01 19:27:23 +0000
committerBrett Bryant <bbryant@digium.com>2011-02-01 19:27:23 +0000
commitf50b132064a3e349a014acdc9de3e3bbd9fa1fb0 (patch)
tree57857d89a96c882e1ee79c2cfde9a02930822e44 /cel
parent62366efb0689dfa0601ee45ddb8779b9b39ce133 (diff)
Merged revisions 305603 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r305603 | bbryant | 2011-02-01 14:23:20 -0500 (Tue, 01 Feb 2011) | 4 lines Add a possible solution to a customer problem with reloading cel_pgsql.so quickly. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cel')
-rw-r--r--cel/cel_pgsql.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cel/cel_pgsql.c b/cel/cel_pgsql.c
index 32ec6302c..ca064ec22 100644
--- a/cel/cel_pgsql.c
+++ b/cel/cel_pgsql.c
@@ -337,31 +337,39 @@ static void pgsql_log(const struct ast_event *event, void *userdata)
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);
+ table = NULL;
}
- AST_RWLIST_WRLOCK(&psql_columns);
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
ast_free(current);
}