summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbevents.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/dbevents.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/dbevents.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp
index 580b4d0d62..50b5f2a8b8 100644
--- a/plugins/Dbx_mdb/src/dbevents.cpp
+++ b/plugins/Dbx_mdb/src/dbevents.cpp
@@ -82,7 +82,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
mir_cslockfull lck(m_csDbAccess);
DWORD dwEventId = ++m_dwMaxEventId;
- for (bool bContactIncremented = false; ;[=](){ if (bContactIncremented) cc->Revert(); }(), Remap()) {
+ for (cc->Snapshot();; cc->Revert(), Remap()) {
txn_ptr txn(m_pMdbEnv);
MDB_val key = { sizeof(int), &dwEventId }, data = { sizeof(DBEvent) + dbe.cbBlob, NULL };
@@ -98,9 +98,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
data.mv_size = 1; data.mv_data = "";
MDB_CHECK(mdb_put(txn, m_dbEventsSort, &key, &data, 0), 0);
- cc->Snapshot();
cc->Advance(dwEventId, dbe);
- bContactIncremented = true;
MDB_val keyc = { sizeof(int), &contactID }, datac = { sizeof(DBContact), &cc->dbc };
MDB_CHECK(mdb_put(txn, m_dbContacts, &keyc, &datac, 0), 0);