]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-491
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 17 Nov 2009 19:37:04 +0000 (19:37 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 17 Nov 2009 19:37:04 +0000 (19:37 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15499 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_sqldb.c

index 8965e78e32d92953315df04fab68ed65fc815e95..21f216af59a18eabe241bc484972fbf92fd2a131 100644 (file)
@@ -546,6 +546,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t * thread,
 
        sql_manager.thread_running = 0;
 
+       switch_cache_db_release_db_handle(&sql_manager.event_db);
+
        return NULL;
 }
 
@@ -1030,9 +1032,6 @@ void switch_core_sqldb_stop(void)
 
        switch_event_unbind(&sql_manager.event_node);
        
-       switch_cache_db_release_db_handle(&sql_manager.event_db);
-       sql_close(0);
-
        if (sql_manager.thread && sql_manager.thread_running) {
 
                if (sql_manager.manage) {
@@ -1045,6 +1044,7 @@ void switch_core_sqldb_stop(void)
                switch_thread_join(&st, sql_manager.thread);
        }
 
+       sql_close(0);
 
        switch_core_hash_destroy(&dbh_hash);