diff --git a/src/share/location_cache/ob_ls_location_map.cpp b/src/share/location_cache/ob_ls_location_map.cpp index cb18946253..27851839a4 100644 --- a/src/share/location_cache/ob_ls_location_map.cpp +++ b/src/share/location_cache/ob_ls_location_map.cpp @@ -82,6 +82,11 @@ void ObLSLocationMap::destroy() ls_buckets_ = NULL; } if (OB_NOT_NULL(buckets_lock_)) { + for (int64_t i = 0; i < BUCKETS_CNT; ++i) { + if (OB_NOT_NULL(buckets_lock_ + i)) { + (buckets_lock_ + i)->~ObQSyncLock(); + } + } ob_free(buckets_lock_); buckets_lock_ = nullptr; } diff --git a/src/storage/tx_storage/ob_ls_map.cpp b/src/storage/tx_storage/ob_ls_map.cpp index fcd164c8df..23feb3df00 100644 --- a/src/storage/tx_storage/ob_ls_map.cpp +++ b/src/storage/tx_storage/ob_ls_map.cpp @@ -122,6 +122,11 @@ void ObLSMap::reset() ls_buckets_ = NULL; } if (OB_NOT_NULL(buckets_lock_)) { + for (int64_t i = 0; i < BUCKETS_CNT; ++i) { + if (OB_NOT_NULL(buckets_lock_ + i)) { + (buckets_lock_ + i)->~ObQSyncLock(); + } + } ob_free(buckets_lock_); buckets_lock_ = nullptr; } @@ -176,6 +181,11 @@ int ObLSMap::init(const int64_t tenant_id, ObIAllocator *ls_allocator) return ret; } +void ObLSMap::destroy() +{ + reset(); +} + int ObLSMap::add_ls( ObLS &ls) { diff --git a/src/storage/tx_storage/ob_ls_map.h b/src/storage/tx_storage/ob_ls_map.h index b8699811e8..9f4ca8bb3e 100644 --- a/src/storage/tx_storage/ob_ls_map.h +++ b/src/storage/tx_storage/ob_ls_map.h @@ -41,9 +41,10 @@ public: { reset(); } - ~ObLSMap() { reset(); } + ~ObLSMap() { destroy(); } void reset(); int init(const int64_t tenant_id, common::ObIAllocator *ls_allocator); + void destroy(); // allow_multi_true is used during replay int add_ls(ObLS &ls); int del_ls(const share::ObLSID &ls_id);