Merge pull request #341 from hryang/master

Fix the memory leak issue in fdcache.
This commit is contained in:
Takeshi Nakatani 2016-02-06 14:41:28 +09:00
commit 8b457133da

View File

@ -276,6 +276,7 @@ bool PageList::Compress(void)
fdpage_list_t::iterator biter = iter;
--biter;
(*biter)->bytes += (*iter)->bytes;
delete *iter;
iter = pages.erase(iter);
}else{
is_last_loaded = (*iter)->loaded;
@ -322,6 +323,7 @@ bool PageList::Resize(size_t size, bool is_loaded)
++iter;
}else{
if(size <= static_cast<size_t>((*iter)->offset)){
delete *iter;
iter = pages.erase(iter);
}else{
(*iter)->bytes = size - static_cast<size_t>((*iter)->offset);