mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-17 17:55:12 +00:00
Fix the memory leak issue in fdcache. See issue #340
This commit is contained in:
parent
8dbd5a3f65
commit
dd9f3aed36
@ -276,6 +276,7 @@ bool PageList::Compress(void)
|
|||||||
fdpage_list_t::iterator biter = iter;
|
fdpage_list_t::iterator biter = iter;
|
||||||
--biter;
|
--biter;
|
||||||
(*biter)->bytes += (*iter)->bytes;
|
(*biter)->bytes += (*iter)->bytes;
|
||||||
|
delete *iter;
|
||||||
iter = pages.erase(iter);
|
iter = pages.erase(iter);
|
||||||
}else{
|
}else{
|
||||||
is_last_loaded = (*iter)->loaded;
|
is_last_loaded = (*iter)->loaded;
|
||||||
@ -322,6 +323,7 @@ bool PageList::Resize(size_t size, bool is_loaded)
|
|||||||
++iter;
|
++iter;
|
||||||
}else{
|
}else{
|
||||||
if(size <= static_cast<size_t>((*iter)->offset)){
|
if(size <= static_cast<size_t>((*iter)->offset)){
|
||||||
|
delete *iter;
|
||||||
iter = pages.erase(iter);
|
iter = pages.erase(iter);
|
||||||
}else{
|
}else{
|
||||||
(*iter)->bytes = size - static_cast<size_t>((*iter)->offset);
|
(*iter)->bytes = size - static_cast<size_t>((*iter)->offset);
|
||||||
|
Loading…
Reference in New Issue
Block a user