提交 0517ab83 编写于 作者: Z zhaozhao.zz

lazyfree: fix memory leak for lazyfree-lazy-server-del

上级 238c9bd0
......@@ -64,9 +64,10 @@ int dbAsyncDelete(redisDb *db, robj *key) {
robj *val = dictGetVal(de);
size_t free_effort = lazyfreeGetFreeEffort(val);
/* If releasing the object is too much work, let's put it into the
* lazy free list. */
if (free_effort > LAZYFREE_THRESHOLD) {
/* If releasing the object is too much work and the refcount
* is 1, that means the object really needs to be freed,
* let's put it into the lazy free list. */
if (free_effort > LAZYFREE_THRESHOLD && val->refcount == 1) {
atomicIncr(lazyfree_objects,1);
bioCreateBackgroundJob(BIO_LAZY_FREE,val,NULL,NULL);
dictSetVal(db->dict,de,NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册