mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
Fixed reading memory after it was deleted. The error was the reason for the ghost feed items.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7849 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8006484242
commit
2b0bdc73bb
1 changed files with 3 additions and 1 deletions
|
@ -2892,7 +2892,6 @@ void RsGenExchange::removeDeleteExistingMessages( RsGeneralDataService::MsgStore
|
||||||
else // remove message from list
|
else // remove message from list
|
||||||
{
|
{
|
||||||
// msg exist in retrieved index
|
// msg exist in retrieved index
|
||||||
delete cit2->first;
|
|
||||||
RsGxsMessageId::std_vector& notifyIds = msgIdsNotify[cit2->second->mGroupId];
|
RsGxsMessageId::std_vector& notifyIds = msgIdsNotify[cit2->second->mGroupId];
|
||||||
RsGxsMessageId::std_vector::iterator it2 = std::find(notifyIds.begin(),
|
RsGxsMessageId::std_vector::iterator it2 = std::find(notifyIds.begin(),
|
||||||
notifyIds.end(), cit2->second->mMsgId);
|
notifyIds.end(), cit2->second->mMsgId);
|
||||||
|
@ -2901,6 +2900,9 @@ void RsGenExchange::removeDeleteExistingMessages( RsGeneralDataService::MsgStore
|
||||||
#ifdef GEN_EXCH_DEBUG
|
#ifdef GEN_EXCH_DEBUG
|
||||||
std::cerr << " discarding " << cit2->second->mMsgId << std::endl;
|
std::cerr << " discarding " << cit2->second->mMsgId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
delete cit2->first;
|
||||||
|
// cit2->second will be deleted too in the destructor of cit2->first (RsNxsMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue