mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Trying to open a transaction in one thread and close it in another is a misuse with LinuxThreads. Doing so may cause memory and file-descriptors to be leaked. Update an assert() and some test cases to account for this.
FossilOrigin-Name: ef99eb57c536d82e7c19fd3d990c17793cc64a3f
This commit is contained in:
@@ -925,7 +925,15 @@ static void releaseOpenCnt(struct unixOpenCnt *pOpen){
|
||||
assert( pOpen->pNext->pPrev==pOpen );
|
||||
pOpen->pNext->pPrev = pOpen->pPrev;
|
||||
}
|
||||
assert( !pOpen->pUnused );
|
||||
assert( !pOpen->pUnused || threadsOverrideEachOthersLocks==0 );
|
||||
|
||||
/* If pOpen->pUnused is not null, then memory and file-descriptors
|
||||
** are leaked.
|
||||
**
|
||||
** This will only happen if, under Linuxthreads, the user has opened
|
||||
** a transaction in one thread, then attempts to close the database
|
||||
** handle from another thread (without first unlocking the db file).
|
||||
** This is a misuse. */
|
||||
sqlite3_free(pOpen);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user