mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-31 18:29:02 -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
|
@ -2224,6 +2224,7 @@ bool ftController::loadList(std::list<RsItem *>& load)
|
|||
/* cleanup */
|
||||
delete (*it);
|
||||
}
|
||||
load.clear() ;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
@ -328,6 +328,8 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
if(sscanf(mit->second.c_str(),"%d",&t) == 1)
|
||||
setWatchPeriod(t);
|
||||
}
|
||||
delete *it ;
|
||||
continue ;
|
||||
}
|
||||
|
||||
RsFileConfigItem *fi = dynamic_cast<RsFileConfigItem *>(*it);
|
||||
|
@ -348,10 +350,13 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
info.shareflags &= ~DIR_FLAGS_NETWORK_WIDE_GROUPS ; // disabling this flag for know, for consistency reasons
|
||||
|
||||
dirList.push_back(info) ;
|
||||
|
||||
delete *it ;
|
||||
}
|
||||
|
||||
/* set directories */
|
||||
setSharedDirectories(dirList);
|
||||
load.clear() ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -484,6 +484,7 @@ bool ftExtraList::loadList(std::list<RsItem *>& load)
|
|||
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
|
||||
|
||||
}
|
||||
load.clear() ;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue