aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/pager.c b/src/pager.c
index a5377d4c3..a02385747 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -1221,9 +1221,10 @@ static void pager_unlock(Pager *pPager){
int rc = SQLITE_OK; /* Return code */
int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0;
- /* Always close the journal file when dropping the database lock.
- ** Otherwise, another connection with journal_mode=delete might
- ** delete the file out from under us.
+ /* If the operating system support deletion of open files, then
+ ** close the journal file when dropping the database lock. Otherwise
+ ** another connection with journal_mode=delete might delete the file
+ ** out from under us.
*/
assert( (PAGER_JOURNALMODE_MEMORY & 5)!=1 );
assert( (PAGER_JOURNALMODE_OFF & 5)!=1 );
@@ -1864,7 +1865,8 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){
zJournal += (sqlite3Strlen30(zJournal)+1);
}
}
-
+
+ sqlite3OsClose(pMaster);
rc = sqlite3OsDelete(pVfs, zMaster, 0);
delmaster_out:
@@ -1874,8 +1876,8 @@ delmaster_out:
if( pMaster ){
sqlite3OsClose(pMaster);
assert( !isOpen(pJournal) );
+ sqlite3_free(pMaster);
}
- sqlite3_free(pMaster);
return rc;
}