summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-02-21 15:38:01 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-02-21 15:38:01 +0000
commit0f56c7c50ab021665a1592eeec59ab7ecfc9a584 (patch)
treea6435a1ae53262e0e29145dbd635456267525444 /plugins/Dbx_mdb/src/dbcontacts.cpp
parentc435188487f1e89942b6ada46808b9103f3f25cd (diff)
dbx_lmdb: some fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index c0c07f0240..d52a581d28 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -109,8 +109,8 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
key.mv_size = sizeof(keyVal); key.mv_data = &keyVal;
MDB_val data;
- txn_ptr trnlck(m_pMdbEnv, true);
- cursor_ptr cursor(trnlck, m_dbEventsSort);
+ txn_ptr txn(m_pMdbEnv);
+ cursor_ptr cursor(txn, m_dbEventsSort);
mdb_cursor_get(cursor, &key, &data, MDB_SET);
while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS)
{
@@ -120,6 +120,7 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
mdb_cursor_del(cursor, 0);
}
+ txn.commit();
return 0;
}
@@ -242,7 +243,7 @@ BOOL CDbxMdb::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub)
delete EI;
}
- MDB_val keyc = { sizeof(int), &ccMeta->contactID }, datac = { sizeof(ccMeta->dbc), &ccMeta->dbc };
+ MDB_val keyc = { sizeof(MCONTACT), &ccMeta->contactID }, datac = { sizeof(ccMeta->dbc), &ccMeta->dbc };
for (;; Remap())
{
@@ -294,7 +295,8 @@ void CDbxMdb::FillContacts()
cursor_ptr_ro cursor(m_curContacts);
MDB_val key, data;
- while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) {
+ while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0)
+ {
DBContact *dbc = (DBContact*)data.mv_data;
if (dbc->dwSignature != DBCONTACT_SIGNATURE)
DatabaseCorruption(NULL);