1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Make sqlite3_shutdown() a no-op if the library is not initialized. (CVS 5364)

FossilOrigin-Name: d725d3bbcef6a8093a246f8ef5b11bf690662393
This commit is contained in:
danielk1977
2008-07-08 12:02:35 +00:00
parent 3aa4b67f04
commit fb437278bb
3 changed files with 17 additions and 11 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.469 2008/07/07 19:52:10 drh Exp $
** $Id: main.c,v 1.470 2008/07/08 12:02:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -130,9 +130,15 @@ int sqlite3_shutdown(void){
sqlite3_mutex_free(sqlite3Config.pInitMutex);
sqlite3Config.pInitMutex = 0;
sqlite3Config.isMallocInit = 0;
sqlite3_os_end();
sqlite3MallocEnd();
sqlite3MutexEnd();
if( sqlite3Config.isInit ){
sqlite3_os_end();
}
if( sqlite3Config.m.xShutdown ){
sqlite3MallocEnd();
}
if( sqlite3Config.mutex.xMutexEnd ){
sqlite3MutexEnd();
}
sqlite3Config.isInit = 0;
return SQLITE_OK;
}