fix trace_id memory leak

This commit is contained in:
nroskill 2021-08-13 10:22:44 +08:00 committed by wangzelin.wzl
parent f75f599289
commit cb4171c327

View File

@ -199,11 +199,8 @@ struct ObCurTraceId {
inline static TraceId* get_trace_id()
{
static RLOCAL(TraceId*, TRACE_ID);
if (OB_UNLIKELY(TRACE_ID == nullptr)) {
TRACE_ID = new (std::nothrow) TraceId();
}
return TRACE_ID;
static thread_local TraceId TRACE_ID;
return &TRACE_ID;
}
inline static void mark_user_request()