fix: free before read issue
This commit is contained in:
parent
8455949575
commit
44d16f78fe
|
@ -41,9 +41,8 @@ void* mpDirectCalloc(SMemPool* pPool, SMPJob* pJob, int64_t num, int64_t size) {
|
|||
}
|
||||
|
||||
void mpDirectFree(SMemPool* pPool, SMPJob* pJob, void *ptr) {
|
||||
taosMemFree(ptr);
|
||||
|
||||
(void)atomic_sub_fetch_64(&pJob->job.allocMemSize, taosMemSize(ptr));
|
||||
taosMemFree(ptr);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1730,7 +1730,7 @@ int32_t taosMemoryPoolInit(mpReserveFailFp failFp, mpReserveReachFp reachFp) {
|
|||
|
||||
|
||||
void taosAutoMemoryFree(void *ptr) {
|
||||
if (NULL != gMemPoolHandle) {
|
||||
if (NULL != gMemPoolHandle && threadPoolEnabled && threadPoolSession) {
|
||||
taosMemPoolFree(gMemPoolHandle, threadPoolSession, ptr, __FILE__, __LINE__);
|
||||
} else {
|
||||
taosMemFree(ptr);
|
||||
|
|
Loading…
Reference in New Issue