Merged revisions 298394 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 06:51:51 +0000 (06:51 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 16 Dec 2010 06:51:51 +0000 (06:51 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r298394 | tilghman | 2010-12-15 18:30:04 -0600 (Wed, 15 Dec 2010) | 22 lines

  Merged revisions 298393 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2

  ................
    r298393 | tilghman | 2010-12-15 18:29:10 -0600 (Wed, 15 Dec 2010) | 15 lines

    Merged revisions 298392 via svnmerge from
    https://origsvn.digium.com/svn/asterisk/branches/1.4

    ........
      r298392 | tilghman | 2010-12-15 18:28:04 -0600 (Wed, 15 Dec 2010) | 8 lines

      Unregister before shutting down the connection, to avoid a race.

      (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/trunk@298441 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_sqlite.c

index a46902c..e21d336 100644 (file)
@@ -188,9 +188,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;
 }