mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 06:31:54 +00:00
Add a possible solution to a customer problem with reloading cel_pgsql.so
quickly. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user