Fix bug that memory leak when allocating iter
This commit is contained in:
parent
5e6e920f2f
commit
dc27ab0653
@ -275,6 +275,16 @@ void ObLSBackupFactory::free(ObBackupTabletCtx *&ctx)
|
||||
OB_DELETE(ObBackupTabletCtx, ObModIds::BACKUP, ctx);
|
||||
}
|
||||
|
||||
void ObLSBackupFactory::free(ObBackupOrderedMacroBlockIndexIterator *&iterator)
|
||||
{
|
||||
OB_DELETE(ObBackupOrderedMacroBlockIndexIterator, ObModIds::BACKUP, iterator);
|
||||
}
|
||||
|
||||
void ObLSBackupFactory::free(ObBackupUnorderedMacroBlockIndexIterator *&iterator)
|
||||
{
|
||||
OB_DELETE(ObBackupUnorderedMacroBlockIndexIterator, ObModIds::BACKUP, iterator);
|
||||
}
|
||||
|
||||
void ObLSBackupFactory::free(ObBackupSSTableSecMetaIterator *&iterator)
|
||||
{
|
||||
OB_DELETE(ObBackupSSTableSecMetaIterator, ObModIds::BACKUP, iterator);
|
||||
|
@ -55,7 +55,8 @@ public:
|
||||
static void free(ObBackupSSTableSecMetaIterator *&iterator);
|
||||
static void free(ObBackupWrapperIODevice *device);
|
||||
static void free(ObIBackupTabletMetaIterator *device);
|
||||
|
||||
static void free(ObBackupUnorderedMacroBlockIndexIterator *&iterator);
|
||||
static void free(ObBackupOrderedMacroBlockIndexIterator *&iterator);
|
||||
private:
|
||||
template <class IT>
|
||||
static void component_free(IT *component)
|
||||
|
@ -1929,6 +1929,10 @@ int ObBackupUnorderdMacroBlockIndexMerger::alloc_merge_iter_(const bool tenant_l
|
||||
LOG_WARN("failed to init macro block index iterator", K(ret), K(merge_param), K(ls_id), K(turn_id));
|
||||
} else {
|
||||
iter = tmp_iter;
|
||||
tmp_iter = NULL;
|
||||
}
|
||||
if (OB_NOT_NULL(tmp_iter)) {
|
||||
ObLSBackupFactory::free(tmp_iter);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@ -1992,8 +1996,12 @@ int ObBackupUnorderdMacroBlockIndexMerger::prepare_prev_backup_set_index_iter_(
|
||||
LOG_WARN("failed to init backup macro range index iterator", K(ret), K(merge_param), K(prev_backup_set_desc), K(prev_tenant_index_retry_id));
|
||||
} else {
|
||||
iter = tmp_iter;
|
||||
tmp_iter = NULL;
|
||||
LOG_INFO("prepare prev backup set index iter", K(prev_backup_set_desc), K(merge_param));
|
||||
}
|
||||
if(OB_NOT_NULL(tmp_iter)){
|
||||
ObLSBackupFactory::free(tmp_iter);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user