diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-16 18:35:26 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-16 18:35:26 +0000 |
commit | cf0b0b736cea27c86850a8b3485bc200bddb35ca (patch) | |
tree | fa4d5a24df04bc5e2aacb438f1d6b0d5e616715b /plugins/Dbx_mdb/src/dbintf.cpp | |
parent | 0cf6c3523f81dc179363b6184175573640f7554c (diff) |
dbx_lmdb: crutches removed; crash fix (?)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16488 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbintf.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbintf.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index 57374de534..521a317b79 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -121,13 +121,21 @@ int CDbxMdb::Load(bool bSkipInit) trnlck.commit();
{
+ MDB_val key, val;
+
mdb_txn_begin(m_pMdbEnv, nullptr, MDB_RDONLY, &m_txn);
mdb_cursor_open(m_txn, m_dbEvents, &m_curEvents);
+ mdb_cursor_get(m_curEvents, &key, &val, MDB_LAST);
+ m_dwMaxEventId = *(MEVENT*)key.mv_data + 1;
+
mdb_cursor_open(m_txn, m_dbEventsSort, &m_curEventsSort);
mdb_cursor_open(m_txn, m_dbSettings, &m_curSettings);
mdb_cursor_open(m_txn, m_dbModules, &m_curModules);
+
mdb_cursor_open(m_txn, m_dbContacts, &m_curContacts);
+ mdb_cursor_get(m_curContacts, &key, &val, MDB_LAST);
+ m_dwMaxContactId = *(DWORD*)key.mv_data + 1;
mdb_txn_reset(m_txn);
}
|