[to #53517978] fix memory leak with collection element assign to null
This commit is contained in:
@ -5668,10 +5668,13 @@ int ObSPIService::spi_reset_collection(ObPLCollection *coll)
|
||||
* ORA-06531: Reference to uninitialized collection
|
||||
* ORA-06512: at line 6
|
||||
* */
|
||||
coll->set_count(OB_INVALID_COUNT);
|
||||
coll->set_first(OB_INVALID_INDEX);
|
||||
coll->set_last(OB_INVALID_INDEX);
|
||||
coll->set_data(NULL);
|
||||
if (OB_NOT_NULL(coll->get_allocator())) {
|
||||
OZ (spi_set_collection(MTL_ID(), NULL, *(coll->get_allocator()), *coll, 0, false));
|
||||
OX (coll->set_count(OB_INVALID_COUNT));
|
||||
} else {
|
||||
CK (coll->get_count() == 0 || coll->get_count() == OB_INVALID_COUNT);
|
||||
OX (coll->set_count(OB_INVALID_COUNT));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user