fix client crash

This commit is contained in:
Hongze Cheng 2020-07-01 18:24:10 +08:00
parent f8f60c45bd
commit 308c2c95fa
1 changed files with 3 additions and 2 deletions

View File

@ -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);
}