summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-03-04 15:55:38 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-03-04 15:55:38 +0000
commitf415b679d51c5cf3630e865efb66825f14f20e4a (patch)
tree8f3329757f03ccbb460592315224e1b672811db4 /plugins/Dbx_mdb
parentfe926ed8e43b615f93fe5ac0ac21b6b706a0236e (diff)
dbx_lmdb: more correct contact deletion
git-svn-id: http://svn.miranda-ng.org/main/trunk@16417 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index 55b34aef5c..14f42e9d70 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -98,13 +98,6 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
MDB_val key = { sizeof(MCONTACT), &contactID }, data;
- for (;; Remap())
- {
- txn_ptr trnlck(m_pMdbEnv);
- MDB_CHECK(mdb_del(trnlck, m_dbContacts, &key, nullptr), 1);
- if (trnlck.commit())
- break;
- }
{
LIST<EventItem> events(50);
GatherContactHistory(contactID, events);
@@ -137,6 +130,14 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID)
txn.commit();
}
+ for (;; Remap())
+ {
+ txn_ptr trnlck(m_pMdbEnv);
+ MDB_CHECK(mdb_del(trnlck, m_dbContacts, &key, nullptr), 1);
+ if (trnlck.commit())
+ break;
+ }
+
m_contactCount--;
m_cache->FreeCachedContact(contactID);
@@ -168,6 +169,7 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::AddContact()
if (trnlck.commit())
break;
}
+ m_contactCount++;
}
NotifyEventHooks(hContactAddedEvent, dwContactId, 0);