From e05e9f4e6fd01c525dbc13c700f1b795a2f5c8f0 Mon Sep 17 00:00:00 2001 From: GongYusen <986957406@qq.com> Date: Thu, 25 Apr 2024 04:26:37 +0000 Subject: [PATCH] bug fix:ps cache unfree ptr error --- src/sql/plan_cache/ob_ps_cache.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sql/plan_cache/ob_ps_cache.cpp b/src/sql/plan_cache/ob_ps_cache.cpp index b28b42a0a..5cf7cab1c 100644 --- a/src/sql/plan_cache/ob_ps_cache.cpp +++ b/src/sql/plan_cache/ob_ps_cache.cpp @@ -48,18 +48,17 @@ ObPsCache::ObPsCache() void ObPsCache::destroy() { + TG_DESTROY(tg_id_); if (inited_) { // ps_stmt_id和ps_stmt_info创建时,会给其增加引用计数 // 现在PsCache要析构了,对所有内部对象减去1,如果引用计数到0,会显式free内存 - TG_DESTROY(tg_id_); cache_evict_all_ps(); - - if (NULL != mem_context_) { - DESTROY_CONTEXT(mem_context_); - mem_context_ = NULL; - } inited_ = false; } + if (NULL != mem_context_) { + DESTROY_CONTEXT(mem_context_); + mem_context_ = NULL; + } } ObPsCache::~ObPsCache()