[Commits] fbca00614: Clean up RangeLockMgr on shutdown

Sergei Petrunia psergey at askmonty.org
Sun Jan 27 11:42:54 EET 2019


revision-id: fbca006149dc8e4b2087fb0f0866bbb7ff202950 (v5.8-1029-gfbca00614)
parent(s): 902585ed89b86b26e8e1ef8b055c268fd1c0e8ca
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2019-01-27 12:42:54 +0300
message:

Clean up RangeLockMgr on shutdown

---
 utilities/transactions/transaction_lock_mgr.cc | 6 ++++++
 utilities/transactions/transaction_lock_mgr.h  | 1 +
 2 files changed, 7 insertions(+)

diff --git a/utilities/transactions/transaction_lock_mgr.cc b/utilities/transactions/transaction_lock_mgr.cc
index 62092948f..d8a3fa28f 100644
--- a/utilities/transactions/transaction_lock_mgr.cc
+++ b/utilities/transactions/transaction_lock_mgr.cc
@@ -1063,6 +1063,12 @@ RangeLockMgr::set_endpoint_cmp_functions(convert_key_to_endpoint_func cvt_func,
   lt= ltm.get_lt(dict_id, cmp , /* on_create_extra*/nullptr);
 }
 
+RangeLockMgr::~RangeLockMgr() {
+  if (lt) {
+    ltm.release_lt(lt);
+  }
+  ltm.destroy();
+}
 
 uint64_t RangeLockMgr::get_escalation_count() {
   LTM_STATUS_S ltm_status_test;
diff --git a/utilities/transactions/transaction_lock_mgr.h b/utilities/transactions/transaction_lock_mgr.h
index e16ce8501..302d6ecee 100644
--- a/utilities/transactions/transaction_lock_mgr.h
+++ b/utilities/transactions/transaction_lock_mgr.h
@@ -216,6 +216,7 @@ class RangeLockMgr :
               const std::string& key, Env* env) override ;
 
   RangeLockMgr(TransactionDB* txn_db);
+  ~RangeLockMgr();
 
   void KillLockWait(TransactionID txnid);
 


More information about the commits mailing list