[CP] Fix: fix memory leak induced by foreign key casacde delete check duplicate rowkey

This commit is contained in:
obdev
2024-03-27 04:15:38 +00:00
committed by ob-robot
parent c169610149
commit 62eb9bd22b
10 changed files with 68 additions and 193 deletions

View File

@ -62,6 +62,18 @@ public:
}
~ObDASCtx()
{
// Destroy the hash set list used for checking duplicate rowkey for foreign key cascade delete
if (!del_ctx_list_.empty()) {
DASDelCtxList::iterator iter = del_ctx_list_.begin();
for (; iter != del_ctx_list_.end(); iter++) {
DmlRowkeyDistCtx& del_ctx = *iter;
if (del_ctx.deleted_rows_ != nullptr) {
del_ctx.deleted_rows_->destroy();
del_ctx.deleted_rows_ = nullptr;
}
}
}
del_ctx_list_.destroy();
}
int init(const ObPhysicalPlan &plan, ObExecContext &ctx);