From f415b679d51c5cf3630e865efb66825f14f20e4a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 4 Mar 2016 15:55:38 +0000 Subject: dbx_lmdb: more correct contact deletion git-svn-id: http://svn.miranda-ng.org/main/trunk@16417 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbcontacts.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp') 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 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); -- cgit v1.2.3