1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

When disconnecting from the 'swarmvtab' extension, close each database prior to invoking the 'openclose' function on it.

FossilOrigin-Name: 3e5647cb6c4553683e24b9cb62548f16c79c4e2ac9e39cf135ea52a623f7cc33
This commit is contained in:
mistachkin
2018-01-09 22:23:42 +00:00
parent 7026bd6753
commit dc006e05aa
4 changed files with 21 additions and 19 deletions

View File

@ -484,14 +484,15 @@ static int unionDisconnect(sqlite3_vtab *pVtab){
int i;
for(i=0; i<pTab->nSrc; i++){
UnionSrc *pSrc = &pTab->aSrc[i];
if( pSrc->db ){
int bHaveSrcDb = (pSrc->db!=0);
sqlite3_close(pSrc->db);
if( bHaveSrcDb ){
unionInvokeOpenClose(pTab, pSrc, 1, 0);
}
sqlite3_free(pSrc->zDb);
sqlite3_free(pSrc->zTab);
sqlite3_free(pSrc->zFile);
sqlite3_free(pSrc->zContext);
sqlite3_close(pSrc->db);
}
sqlite3_finalize(pTab->pNotFound);
sqlite3_finalize(pTab->pOpenClose);