Fossil SCM

Use more aggressive cleanup when coming back from the 'sqlite' command, to permit TH1 hooks to exit cleanly.

mistachkin 2014-10-17 23:51 trunk
Commit b8b037610f7f717471200ad93a9d603bf9a49f0a
1 file changed +4
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -148,11 +148,15 @@
148148
extern int sqlite3_shell(int, char**);
149149
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
150150
db_close(1);
151151
sqlite3_shutdown();
152152
sqlite3_shell(g.argc-1, g.argv+1);
153
+ sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit);
153154
g.db = 0;
155
+ g.zMainDbType = 0;
156
+ g.repositoryOpen = 0;
157
+ g.localOpen = 0;
154158
}
155159
156160
/*
157161
** This routine is called by the patched sqlite3 command-line shell in order
158162
** to load the name and database connection for the open Fossil database.
159163
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -148,11 +148,15 @@
148 extern int sqlite3_shell(int, char**);
149 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
150 db_close(1);
151 sqlite3_shutdown();
152 sqlite3_shell(g.argc-1, g.argv+1);
 
153 g.db = 0;
 
 
 
154 }
155
156 /*
157 ** This routine is called by the patched sqlite3 command-line shell in order
158 ** to load the name and database connection for the open Fossil database.
159
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -148,11 +148,15 @@
148 extern int sqlite3_shell(int, char**);
149 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
150 db_close(1);
151 sqlite3_shutdown();
152 sqlite3_shell(g.argc-1, g.argv+1);
153 sqlite3_cancel_auto_extension((void(*)(void))sqlcmd_autoinit);
154 g.db = 0;
155 g.zMainDbType = 0;
156 g.repositoryOpen = 0;
157 g.localOpen = 0;
158 }
159
160 /*
161 ** This routine is called by the patched sqlite3 command-line shell in order
162 ** to load the name and database connection for the open Fossil database.
163

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button