]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Unregister before shutting down the connection, to avoid a race.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 00:28:04 +0000 (00:28 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 00:28:04 +0000 (00:28 +0000)
(closes issue #18481)
 Reported by: pabelanger
 Patches:
       20101215__issue18481.diff.txt uploaded by tilghman (license 14)
 Tested by: pabelanger

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@298392 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_sqlite.c

index 5aa8a515489b863f0854384c12fcdaf362f3cf4c..cbf6550649927f59c3e11e9e90986b86ccc09212 100644 (file)
@@ -167,9 +167,10 @@ static int sqlite_log(struct ast_cdr *cdr)
 
 static int unload_module(void)
 {
-       if (db)
-               sqlite_close(db);
        ast_cdr_unregister(name);
+       if (db) {
+               sqlite_close(db);
+       }
        return 0;
 }