|
|
@ -337,31 +337,39 @@ static void pgsql_log(const struct ast_event *event, void *userdata)
|
|
|
|
static int my_unload_module(void)
|
|
|
|
static int my_unload_module(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct columns *current;
|
|
|
|
struct columns *current;
|
|
|
|
|
|
|
|
AST_RWLIST_WRLOCK(&psql_columns);
|
|
|
|
if (event_sub) {
|
|
|
|
if (event_sub) {
|
|
|
|
event_sub = ast_event_unsubscribe(event_sub);
|
|
|
|
event_sub = ast_event_unsubscribe(event_sub);
|
|
|
|
|
|
|
|
event_sub = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (conn) {
|
|
|
|
if (conn) {
|
|
|
|
PQfinish(conn);
|
|
|
|
PQfinish(conn);
|
|
|
|
|
|
|
|
conn = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pghostname) {
|
|
|
|
if (pghostname) {
|
|
|
|
ast_free(pghostname);
|
|
|
|
ast_free(pghostname);
|
|
|
|
|
|
|
|
pghostname = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pgdbname) {
|
|
|
|
if (pgdbname) {
|
|
|
|
ast_free(pgdbname);
|
|
|
|
ast_free(pgdbname);
|
|
|
|
|
|
|
|
pgdbname = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pgdbuser) {
|
|
|
|
if (pgdbuser) {
|
|
|
|
ast_free(pgdbuser);
|
|
|
|
ast_free(pgdbuser);
|
|
|
|
|
|
|
|
pgdbuser = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pgpassword) {
|
|
|
|
if (pgpassword) {
|
|
|
|
ast_free(pgpassword);
|
|
|
|
ast_free(pgpassword);
|
|
|
|
|
|
|
|
pgpassword = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pgdbport) {
|
|
|
|
if (pgdbport) {
|
|
|
|
ast_free(pgdbport);
|
|
|
|
ast_free(pgdbport);
|
|
|
|
|
|
|
|
pgdbport = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (table) {
|
|
|
|
if (table) {
|
|
|
|
ast_free(table);
|
|
|
|
ast_free(table);
|
|
|
|
|
|
|
|
table = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AST_RWLIST_WRLOCK(&psql_columns);
|
|
|
|
|
|
|
|
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
|
|
|
|
while ((current = AST_RWLIST_REMOVE_HEAD(&psql_columns, list))) {
|
|
|
|
ast_free(current);
|
|
|
|
ast_free(current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|