to issue<48587285>:fix memory leak about pl collection shrink

This commit is contained in:
obdev 2023-03-24 07:11:52 +00:00 committed by ob-robot
parent d2110be61c
commit f9b0da4444
2 changed files with 11 additions and 0 deletions

View File

@ -74,6 +74,16 @@ int ObPLAllocator::shrink()
return ret;
}
int ObPLCollAllocator::free_child_coll(ObPLCollection &dest)
{
int ret = OB_SUCCESS;
for (int64_t i = 0; OB_SUCC(ret) && i < dest.get_count(); ++i) {
OZ (ObUserDefinedType::destruct_obj(dest.get_data()[i], NULL));
}
return ret;
}
int ObPLCollAllocator::copy_all_element_with_new_allocator(ObIAllocator *allocator)
{
int ret = OB_SUCCESS;

View File

@ -81,6 +81,7 @@ public:
ObPLAllocator(), coll_(coll) {}
virtual int copy_all_element_with_new_allocator(ObIAllocator *allocator) override;
static int free_child_coll(ObPLCollection &dest);
private:
ObPLCollection* coll_;