diff --git a/source/util/src/tgeosctx.c b/source/util/src/tgeosctx.c index 41d9bb9ae3..9248c8cf58 100644 --- a/source/util/src/tgeosctx.c +++ b/source/util/src/tgeosctx.c @@ -68,6 +68,10 @@ int32_t getThreadLocalGeosCtx(SGeosContext **ppCtx) { TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); } + if ((taosThreadSetSpecific(tlGeosCtxKey, &tlGeosCtxObj)) != 0) { + TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); + } + tlGeosCtx = &tlGeosCtxObj; *ppCtx = tlGeosCtx; _exit: