[td-1315]
This commit is contained in:
parent
39e55b2021
commit
510be65028
|
@ -366,7 +366,9 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
|
||||||
if (inTrashCan) {
|
if (inTrashCan) {
|
||||||
ref = T_REF_VAL_GET(pNode);
|
ref = T_REF_VAL_GET(pNode);
|
||||||
|
|
||||||
if (ref == 1) { // it is the last ref,
|
if (ref == 1) {
|
||||||
|
// If it is the last ref, remove it from trashcan linked-list first, and then destroy it.Otherwise, it may be
|
||||||
|
// destroyed by refresh worker if decrease ref count before removing it from linked-list.
|
||||||
assert(pNode->pTNodeHeader->pData == pNode);
|
assert(pNode->pTNodeHeader->pData == pNode);
|
||||||
|
|
||||||
__cache_wr_lock(pCacheObj);
|
__cache_wr_lock(pCacheObj);
|
||||||
|
@ -379,7 +381,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
|
||||||
doDestroyTrashcanElem(pCacheObj, pNode->pTNodeHeader);
|
doDestroyTrashcanElem(pCacheObj, pNode->pTNodeHeader);
|
||||||
} else {
|
} else {
|
||||||
ref = T_REF_DEC(pNode);
|
ref = T_REF_DEC(pNode);
|
||||||
assert(ref > 0);
|
assert(ref >= 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// NOTE: remove it from hash in the first place, otherwise, the pNode may have been released by other thread
|
// NOTE: remove it from hash in the first place, otherwise, the pNode may have been released by other thread
|
||||||
|
|
Loading…
Reference in New Issue