mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-16 01:54:52 -04:00
fixed some leaking memory issues in loadList() methods, and also increased consistency by not returning non empty list with deleted items inside
This commit is contained in:
parent
48750cdb51
commit
8a41554754
22 changed files with 208 additions and 164 deletions
|
@ -307,7 +307,8 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
|
|||
RsHistoryMsgItem *msgItem;
|
||||
std::list<RsItem*>::iterator it;
|
||||
|
||||
for (it = load.begin(); it != load.end(); ++it) {
|
||||
for (it = load.begin(); it != load.end(); ++it)
|
||||
{
|
||||
if (NULL != (msgItem = dynamic_cast<RsHistoryMsgItem*>(*it))) {
|
||||
|
||||
std::map<RsPeerId, std::map<uint32_t, RsHistoryMsgItem*> >::iterator mit = mMessages.find(msgItem->chatPeerId);
|
||||
|
@ -381,6 +382,7 @@ bool p3HistoryMgr::loadList(std::list<RsItem*>& load)
|
|||
delete (*it);
|
||||
}
|
||||
|
||||
load.clear() ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue