aboutsummaryrefslogtreecommitdiff
path: root/src/wal.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-05-13 09:11:31 +0000
committerdrh <drh@noemail.net>2010-05-13 09:11:31 +0000
commit5500a1f1e64dd78eaf75d2925311d0759cda4d22 (patch)
tree1b9ba5543470a7f399bb518ec96d67f81444041a /src/wal.c
parent043c20e63e7c075e85ef554fdf7bbba5cd9c0ea7 (diff)
downloadsqlite-5500a1f1e64dd78eaf75d2925311d0759cda4d22.tar.gz
sqlite-5500a1f1e64dd78eaf75d2925311d0759cda4d22.zip
Make sure xShmGet is never called while already holding the shared-memory
segment. FossilOrigin-Name: 92ebdbc5f64ac63796ff56c1e1aec3b95c6bdd20
Diffstat (limited to 'src/wal.c')
-rw-r--r--src/wal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wal.c b/src/wal.c
index 3c16dccc3..5f4079e27 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -419,6 +419,7 @@ static void walIndexUnmap(Wal *pWal){
static int walIndexMap(Wal *pWal, int reqSize){
int rc = SQLITE_OK;
if( pWal->pWiData==0 || reqSize>pWal->szWIndex ){
+ walIndexUnmap(pWal);
rc = sqlite3OsShmGet(pWal->pDbFd, reqSize, &pWal->szWIndex,
(void**)(char*)&pWal->pWiData);
if( rc==SQLITE_OK && pWal->pWiData==0 ){