Merge pull request #22808 from taosdata/fix/TD-25644

fix(tdb/pcache): fix mem leak with unpined pages
This commit is contained in:
wade zhang 2023-09-08 12:35:17 +08:00 committed by GitHub
commit c90670ecdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -229,7 +229,15 @@ void tdbPCacheInvalidatePage(SPCache *pCache, SPager *pPager, SPgno pgno) {
}
if (pPage) {
bool moveToFreeList = false;
if (pPage->pLruNext) {
tdbPCachePinPage(pCache, pPage);
moveToFreeList = true;
}
tdbPCacheRemovePageFromHash(pCache, pPage);
if (moveToFreeList) {
tdbPCacheFreePage(pCache, pPage);
}
}
}