diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-10-17 23:25:34 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-10-17 23:25:34 -0500 |
commit | e165fdb27c1eee85ae2cce5b5d9a494da09e6da3 (patch) | |
tree | d022932d844bcb8470bac960157d4c77d93b205b | |
parent | Merge pull request #7808 (diff) | |
parent | LMDB: protection against UB, by not calling virtual methods from destructor (diff) | |
download | monero-e165fdb27c1eee85ae2cce5b5d9a494da09e6da3.tar.xz |
Merge pull request #7859
514f8fa LMDB: protection against UB, by not calling virtual methods from destructor (mj-xmr)
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index c059a3e29..de2700ad0 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1276,11 +1276,11 @@ BlockchainLMDB::~BlockchainLMDB() // batch transaction shouldn't be active at this point. If it is, consider it aborted. if (m_batch_active) { - try { batch_abort(); } + try { BlockchainLMDB::batch_abort(); } catch (...) { /* ignore */ } } if (m_open) - close(); + BlockchainLMDB::close(); } BlockchainLMDB::BlockchainLMDB(bool batch_transactions): BlockchainDB() @@ -1578,9 +1578,9 @@ void BlockchainLMDB::close() if (m_batch_active) { LOG_PRINT_L3("close() first calling batch_abort() due to active batch transaction"); - batch_abort(); + BlockchainLMDB::batch_abort(); } - this->sync(); + BlockchainLMDB::sync(); m_tinfo.reset(); // FIXME: not yet thread safe!!! Use with care. @@ -1593,7 +1593,7 @@ void BlockchainLMDB::sync() LOG_PRINT_L3("BlockchainLMDB::" << __func__); check_open(); - if (is_read_only()) + if (BlockchainLMDB::is_read_only()) return; // Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part |