diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-25 13:00:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-25 13:00:15 +0300 |
commit | a949c9f2b090435ca63de525ee2cd1a79073f08a (patch) | |
tree | 30cda465107265cbaa5230cd82faf72a45e4d76b /plugins/Dbx_mdbx/src/dbintf.h | |
parent | 24a7f4bcff2953017070a7610ac3414984bcb0f9 (diff) |
fixes #2569 (Miranda uses libmdbx unsafely)
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbintf.h')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbintf.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h index 9dadb8a8fc..d2c8811d8b 100644 --- a/plugins/Dbx_mdbx/src/dbintf.h +++ b/plugins/Dbx_mdbx/src/dbintf.h @@ -158,15 +158,6 @@ class CDbxMDBX : public MDatabaseCommon, public MIDatabaseChecker, public MZeroe }
} m_impl;
- __forceinline MDBX_txn* StartTran()
- {
- MDBX_txn *res = 0;
- m_dbError = mdbx_txn_begin(m_env, nullptr, (m_bReadOnly) ? MDBX_TXN_RDONLY : MDBX_TXN_READWRITE, &res);
- /* FIXME: throw an exception */
- _ASSERT(m_dbError == MDBX_SUCCESS);
- return res;
- }
-
bool CheckEvent(DBCachedContact *cc, const DBEvent *dbe, DBCachedContact *&cc2);
bool EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbe, bool bNew);
void FillContacts(void);
@@ -174,6 +165,8 @@ class CDbxMDBX : public MDatabaseCommon, public MIDatabaseChecker, public MZeroe void TouchFile(void);
void UpdateMenuItem(void);
+ MDBX_txn* StartTran();
+
////////////////////////////////////////////////////////////////////////////
// database stuff
@@ -187,6 +180,8 @@ class CDbxMDBX : public MDatabaseCommon, public MIDatabaseChecker, public MZeroe MDBX_dbi m_dbGlobal;
DBHeader m_header;
+ MDBX_txn *m_txnWrite = nullptr;
+
DBCachedContact m_ccDummy; // dummy contact to serve a cache item for MCONTACT = 0
////////////////////////////////////////////////////////////////////////////
|