summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src/dbcontacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-11-16 20:17:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-11-16 20:17:27 +0300
commit7bb7189d67da6f916bbc9f4076d1319cd03f65d2 (patch)
treeb12a5ada678447adcbe9ed82faafa5aa69794c81 /plugins/Dbx_mdbx/src/dbcontacts.cpp
parentefe255d24291ca83efa9caee3696a8f1451b3b11 (diff)
Dbx_mdbx: global cursors replaced with mdbx_cursor_bind() and temporary cursors
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdbx/src/dbcontacts.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcontacts.cpp b/plugins/Dbx_mdbx/src/dbcontacts.cpp
index 67e5d2be6f..0236a3ea08 100644
--- a/plugins/Dbx_mdbx/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdbx/src/dbcontacts.cpp
@@ -149,9 +149,9 @@ void CDbxMDBX::GatherContactHistory(MCONTACT hContact, OBJLIST<EventItem> &list)
MDBX_val key = { &keyVal, sizeof(keyVal) }, data;
txn_ptr_ro trnlck(m_txn_ro);
- cursor_ptr_ro cursor(m_curEventsSort);
+ mdbx_cursor_bind(m_txn_ro, m_curEventsSort, m_dbEventsSort);
- for (int res = mdbx_cursor_get(cursor, &key, &data, MDBX_SET_RANGE); res == MDBX_SUCCESS; res = mdbx_cursor_get(cursor, &key, &data, MDBX_NEXT)) {
+ for (int res = mdbx_cursor_get(m_curEventsSort, &key, &data, MDBX_SET_RANGE); res == MDBX_SUCCESS; res = mdbx_cursor_get(m_curEventsSort, &key, &data, MDBX_NEXT)) {
const DBEventSortingKey *pKey = (const DBEventSortingKey*)key.iov_base;
if (pKey->hContact != hContact)
return;
@@ -286,10 +286,10 @@ void CDbxMDBX::FillContacts()
{
{
txn_ptr_ro trnlck(m_txn_ro);
- cursor_ptr_ro cursor(m_curContacts);
+ cursor_ptr pCursor(m_txn_ro, m_dbContacts);
MDBX_val key, data;
- while (mdbx_cursor_get(cursor, &key, &data, MDBX_NEXT) == MDBX_SUCCESS) {
+ while (mdbx_cursor_get(pCursor, &key, &data, MDBX_NEXT) == MDBX_SUCCESS) {
DBCachedContact *cc = m_cache->AddContactToCache(*(MCONTACT*)key.iov_base);
cc->dbc = *(DBContact*)data.iov_base;
}