[to #53517978] fix memory leak with collection element assign to null

This commit is contained in:
obdev
2023-12-14 09:13:05 +00:00
committed by ob-robot
parent 7cd28da528
commit e1155848a1

View File

@ -5668,10 +5668,13 @@ int ObSPIService::spi_reset_collection(ObPLCollection *coll)
* ORA-06531: Reference to uninitialized collection * ORA-06531: Reference to uninitialized collection
* ORA-06512: at line 6 * ORA-06512: at line 6
* */ * */
coll->set_count(OB_INVALID_COUNT); if (OB_NOT_NULL(coll->get_allocator())) {
coll->set_first(OB_INVALID_INDEX); OZ (spi_set_collection(MTL_ID(), NULL, *(coll->get_allocator()), *coll, 0, false));
coll->set_last(OB_INVALID_INDEX); OX (coll->set_count(OB_INVALID_COUNT));
coll->set_data(NULL); } else {
CK (coll->get_count() == 0 || coll->get_count() == OB_INVALID_COUNT);
OX (coll->set_count(OB_INVALID_COUNT));
}
} }
return ret; return ret;
} }