fix session-based context dynamic leak

This commit is contained in:
obdev
2023-04-26 14:27:48 +00:00
committed by ob-robot
parent 0f7e23e3f5
commit dbedb800a4
2 changed files with 3 additions and 2 deletions

View File

@ -285,7 +285,6 @@ void ObSQLSessionInfo::reset(bool skip_sys_var)
session_type_ = INVALID_TYPE;
package_state_map_.reuse();
sequence_currval_map_.reuse();
contexts_map_.reuse();
curr_session_context_size_ = 0;
pl_context_ = NULL;
pl_can_retry_ = true;
@ -314,6 +313,7 @@ void ObSQLSessionInfo::reset(bool skip_sys_var)
DESTROY_CONTEXT(mem_context_);
mem_context_ = NULL;
}
contexts_map_.reuse();
cur_exec_ctx_ = nullptr;
plan_cache_ = NULL;
client_app_info_.reset();
@ -2110,6 +2110,7 @@ int ObSQLSessionInfo::clear_all_context(const ObString &context_name)
app_ctx_info_encoder_.is_changed_ = true;
curr_session_context_size_ -= inner_map->context_map_->size();
inner_map->destroy();
mem_context_->get_malloc_allocator().free(inner_map);
}
return ret;
}