mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Hold the database handle mutex for the duration of sqlite3_db_release_memory().
FossilOrigin-Name: eeaf2988004ff5343be60ab4ba2f809f76c94b51
This commit is contained in:
@@ -540,6 +540,7 @@ sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
|
||||
*/
|
||||
int sqlite3_db_release_memory(sqlite3 *db){
|
||||
int i;
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
sqlite3BtreeEnterAll(db);
|
||||
for(i=0; i<db->nDb; i++){
|
||||
Btree *pBt = db->aDb[i].pBt;
|
||||
@@ -549,6 +550,7 @@ int sqlite3_db_release_memory(sqlite3 *db){
|
||||
}
|
||||
}
|
||||
sqlite3BtreeLeaveAll(db);
|
||||
sqlite3_mutex_leave(db->mutex);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user