mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
Merge pull request #1656
edfd7f6e
Workaround VL32 cursor refcounting miscount (Howard Chu)
This commit is contained in:
commit
da9174c8ee
16
external/db_drivers/liblmdb/mdb.c
vendored
16
external/db_drivers/liblmdb/mdb.c
vendored
@ -1953,13 +1953,15 @@ static void
|
||||
mdb_cursor_unref(MDB_cursor *mc)
|
||||
{
|
||||
int i;
|
||||
if (!mc->mc_snum || !mc->mc_pg[0] || IS_SUBP(mc->mc_pg[0]))
|
||||
return;
|
||||
for (i=0; i<mc->mc_snum; i++)
|
||||
mdb_page_unref(mc->mc_txn, mc->mc_pg[i]);
|
||||
if (mc->mc_ovpg) {
|
||||
mdb_page_unref(mc->mc_txn, mc->mc_ovpg);
|
||||
mc->mc_ovpg = 0;
|
||||
if (mc->mc_txn->mt_rpages[0].mid) {
|
||||
if (!mc->mc_snum || !mc->mc_pg[0] || IS_SUBP(mc->mc_pg[0]))
|
||||
return;
|
||||
for (i=0; i<mc->mc_snum; i++)
|
||||
mdb_page_unref(mc->mc_txn, mc->mc_pg[i]);
|
||||
if (mc->mc_ovpg) {
|
||||
mdb_page_unref(mc->mc_txn, mc->mc_ovpg);
|
||||
mc->mc_ovpg = 0;
|
||||
}
|
||||
}
|
||||
mc->mc_snum = mc->mc_top = 0;
|
||||
mc->mc_pg[0] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user