[CP] fix core when create_tg_tenant with no_memory
This commit is contained in:
4
deps/oblib/src/lib/thread/thread_mgr.cpp
vendored
4
deps/oblib/src/lib/thread/thread_mgr.cpp
vendored
@ -46,8 +46,10 @@ void lib_init_create_func()
|
|||||||
{
|
{
|
||||||
#define TG_DEF(id, name, type, args...) \
|
#define TG_DEF(id, name, type, args...) \
|
||||||
create_funcs_[TGDefIDs::id] = []() { \
|
create_funcs_[TGDefIDs::id] = []() { \
|
||||||
auto ret = OB_NEW(TG_##type, SET_USE_500("tg"), args); \
|
TG_##type *ret = OB_NEW(TG_##type, SET_USE_500("tg"), args); \
|
||||||
|
if (NULL != ret) { \
|
||||||
ret->attr_ = {#name, TGType::type}; \
|
ret->attr_ = {#name, TGType::type}; \
|
||||||
|
} \
|
||||||
return ret; \
|
return ret; \
|
||||||
};
|
};
|
||||||
#include "lib/thread/thread_define.h"
|
#include "lib/thread/thread_define.h"
|
||||||
|
|||||||
@ -37,8 +37,10 @@ void ob_init_create_func()
|
|||||||
{
|
{
|
||||||
#define TG_DEF(id, name, type, args...) \
|
#define TG_DEF(id, name, type, args...) \
|
||||||
lib::create_funcs_[lib::TGDefIDs::id] = []() { \
|
lib::create_funcs_[lib::TGDefIDs::id] = []() { \
|
||||||
auto ret = OB_NEW(TG_##type, SET_USE_500("tg"), args); \
|
TG_##type *ret = OB_NEW(TG_##type, SET_USE_500("tg"), args); \
|
||||||
|
if (NULL != ret) { \
|
||||||
ret->attr_ = {#name, TGType::type}; \
|
ret->attr_ = {#name, TGType::type}; \
|
||||||
|
} \
|
||||||
return ret; \
|
return ret; \
|
||||||
};
|
};
|
||||||
#include "share/ob_thread_define.h"
|
#include "share/ob_thread_define.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user