From 308c2c95fa1c18117c6fc69ff8241434d40e81eb Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 1 Jul 2020 18:24:10 +0800 Subject: [PATCH] fix client crash --- src/util/src/tcache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/src/tcache.c b/src/util/src/tcache.c index 91d559a92b..a1f40b6e27 100644 --- a/src/util/src/tcache.c +++ b/src/util/src/tcache.c @@ -432,7 +432,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) { int16_t ref = T_REF_DEC(pNode); uDebug("%p data released, refcnt:%d", pNode, ref); - if (_remove) { + if (_remove && (!pNode->inTrashCan)) { __cache_wr_lock(pCacheObj); if (T_REF_VAL_GET(pNode) == 0) { @@ -546,7 +546,8 @@ void taosRemoveFromTrashCan(SCacheObj *pCacheObj, STrashElem *pElem) { if (pCacheObj->freeFp) { pCacheObj->freeFp(pElem->pData->data); } - + + uError("-------------------free obj:%p", pElem->pData); free(pElem->pData); free(pElem); } -- GitLab