fix: fix tsc query memory leak
This commit is contained in:
parent
ac542e9164
commit
a80f382c5d
|
@ -190,28 +190,20 @@ int32_t nodesReleaseAllocator(int64_t allocatorId) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
SNodeAllocator* pAllocator = taosAcquireRef(g_allocatorReqRefPool, allocatorId);
|
||||
if (NULL == pAllocator) {
|
||||
return terrno;
|
||||
}
|
||||
|
||||
int32_t code = taosThreadMutexTryLock(&pAllocator->mutex);
|
||||
if (EBUSY != code) {
|
||||
if (NULL == g_pNodeAllocator) {
|
||||
nodesError("allocator id %" PRIx64
|
||||
" release failed: The nodesReleaseAllocator function needs to be called after the nodesAcquireAllocator "
|
||||
"function is called!",
|
||||
allocatorId);
|
||||
if (0 == code) {
|
||||
taosThreadMutexUnlock(&pAllocator->mutex);
|
||||
}
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
SNodeAllocator* pAllocator = g_pNodeAllocator;
|
||||
g_pNodeAllocator = NULL;
|
||||
taosThreadMutexUnlock(&pAllocator->mutex);
|
||||
return taosReleaseRef(g_allocatorReqRefPool, allocatorId);
|
||||
}
|
||||
|
||||
|
||||
int64_t nodesMakeAllocatorWeakRef(int64_t allocatorId) {
|
||||
if (allocatorId <= 0) {
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue