mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 22:51:12 -04:00
fixed bug causing bad cache update
This commit is contained in:
parent
a6010beab3
commit
ef21db0a0a
3 changed files with 5 additions and 9 deletions
|
@ -838,7 +838,8 @@ int RsDataService::storeMessage(const std::list<RsNxsMsg*>& msg)
|
|||
|
||||
// This is needed so that mLastPost is correctly updated in the group meta when it is re-loaded.
|
||||
|
||||
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
||||
if(mUseCache)
|
||||
mMsgMetaDataCache[msgMetaPtr->mGroupId].updateMeta(msgMetaPtr->mMsgId,*msgMetaPtr);
|
||||
|
||||
delete *mit;
|
||||
}
|
||||
|
|
|
@ -81,12 +81,7 @@ public:
|
|||
|
||||
void updateMeta(const ID& id,const MetaDataClass& meta)
|
||||
{
|
||||
auto it = mMetas.find(id) ;
|
||||
|
||||
if(it != mMetas.end())
|
||||
*(it->second) = meta ;
|
||||
else
|
||||
mMetas[id] = std::make_shared<MetaDataClass>();
|
||||
mMetas[id] = std::make_shared<MetaDataClass>(meta); // create a new shared_ptr to possibly replace the previous one
|
||||
}
|
||||
|
||||
void clear(const ID& id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue