diff options
author | danielk1977 <danielk1977@noemail.net> | 2009-02-17 16:29:10 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2009-02-17 16:29:10 +0000 |
commit | 0a5490715925605759dfa60991f974bcc184d1be (patch) | |
tree | 2e83a83699893b8494c0f21f6a6ae532899c8558 /src/tclsqlite.c | |
parent | e8df800d4cb57917b4d909678cb467a200120e96 (diff) | |
download | sqlite-0a5490715925605759dfa60991f974bcc184d1be.tar.gz sqlite-0a5490715925605759dfa60991f974bcc184d1be.zip |
Allow sqlite3_shutdown() to be called by a process before sqlite3_initialize() is. Prior to this commit such a call could segfault. (CVS 6296)
FossilOrigin-Name: 79431c58d964d6057c7f42f7c1df74f3df4493eb
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r-- | src/tclsqlite.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 4e7f77dd2..585360f56 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -12,7 +12,7 @@ ** A TCL Interface to SQLite. Append this file to sqlite3.c and ** compile the whole thing to build a TCL-enabled version of SQLite. ** -** $Id: tclsqlite.c,v 1.236 2009/02/04 22:46:47 drh Exp $ +** $Id: tclsqlite.c,v 1.237 2009/02/17 16:29:11 danielk1977 Exp $ */ #include "tcl.h" #include <errno.h> @@ -2744,6 +2744,12 @@ static char zMainloop[] = #define TCLSH_MAIN main /* Needed to fake out mktclapp */ int TCLSH_MAIN(int argc, char **argv){ Tcl_Interp *interp; + + /* Call sqlite3_shutdown() once before doing anything else. This is to + ** test that sqlite3_shutdown() can be safely called by a process before + ** sqlite3_initialize() is. */ + sqlite3_shutdown(); + Tcl_FindExecutable(argv[0]); interp = Tcl_CreateInterp(); Sqlite3_Init(interp); |