avoid potential memory leak for cache files that have been downloaded multiple times. Not sure that this is the cause anyway.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.5@7242 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-04-06 07:37:24 +00:00
parent 7c33210b45
commit 5df55a4f1f

View File

@ -890,7 +890,16 @@ bool ftController::completeFile(std::string hash)
/* switch map */
if (!(fc->mFlags & RS_FILE_REQ_CACHE)) /* clean up completed cache files automatically */
{
std::map<std::string,ftFileControl*>::iterator it = mCompleted.find(fc->mHash) ;
if(it != mCompleted.end())
{
delete it->second ;
it->second = fc ;
}
else
mCompleted[fc->mHash] = fc;
completeCount = mCompleted.size();
} else
delete fc ;