提交 24edf85f 编写于 作者: O obdev 提交者: wangzelin.wzl

fix LSMap do not release QSync memory when destroied

上级 ef6584d4
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册