Prevent deadlock of database mutex
This commit is contained in:
parent
d7120d73b4
commit
e873a49d99
|
@ -365,7 +365,11 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
|
||||||
/* point the internal codec argument against the contet to be prepared */
|
/* point the internal codec argument against the contet to be prepared */
|
||||||
rc = sqlcipher_codec_ctx_init(&ctx, pDb, pDb->pBt->pBt->pPager, fd, zKey, nKey);
|
rc = sqlcipher_codec_ctx_init(&ctx, pDb, pDb->pBt->pBt->pPager, fd, zKey, nKey);
|
||||||
|
|
||||||
if(rc != SQLITE_OK) return rc; /* initialization failed, do not attach potentially corrupted context */
|
if(rc != SQLITE_OK) {
|
||||||
|
/* initialization failed, do not attach potentially corrupted context */
|
||||||
|
sqlite3_mutex_leave(db->mutex);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
sqlite3pager_sqlite3PagerSetCodec(sqlite3BtreePager(pDb->pBt), sqlite3Codec, NULL, sqlite3FreeCodecArg, (void *) ctx);
|
sqlite3pager_sqlite3PagerSetCodec(sqlite3BtreePager(pDb->pBt), sqlite3Codec, NULL, sqlite3FreeCodecArg, (void *) ctx);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue