diff options
author | mistachkin <mistachkin@noemail.net> | 2015-08-20 21:14:31 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2015-08-20 21:14:31 +0000 |
commit | 197d59ffc4fe46fb12dcf62bb248c102fc0d5ecf (patch) | |
tree | 0542195de9224949c17ce65144055b2e4acd14e7 /src | |
parent | bc63ec1d6255065472e573d7fb3fea2288561280 (diff) | |
download | sqlite-197d59ffc4fe46fb12dcf62bb248c102fc0d5ecf.tar.gz sqlite-197d59ffc4fe46fb12dcf62bb248c102fc0d5ecf.zip |
Skip calling the virtual table xDestroy method when it is null.
FossilOrigin-Name: b73ad305a6b7cb84fe0a1efb334b8e4592e21c40
Diffstat (limited to 'src')
-rw-r--r-- | src/vtab.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vtab.c b/src/vtab.c index fca8170d2..8042e0e7b 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -801,6 +801,7 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){ pTab = sqlite3FindTable(db, zTab, db->aDb[iDb].zName); if( ALWAYS(pTab!=0 && pTab->pVTable!=0) ){ VTable *p; + int (*xDestroy)(sqlite3_vtab *); for(p=pTab->pVTable; p; p=p->pNext){ assert( p->pVtab ); if( p->pVtab->nRef>0 ){ @@ -808,7 +809,8 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){ } } p = vtabDisconnectAll(db, pTab); - rc = p->pMod->pModule->xDestroy(p->pVtab); + xDestroy = p->pMod->pModule->xDestroy; + rc = xDestroy ? xDestroy(p->pVtab) : SQLITE_OK; /* Remove the sqlite3_vtab* from the aVTrans[] array, if applicable */ if( rc==SQLITE_OK ){ assert( pTab->pVTable==p && p->pNext==0 ); |