mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-28 18:42:20 -04:00
fixed some mutex bugs and some pointer access bugs in the FileIndexStore
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1525 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
caf1c7850f
commit
243af3ffee
3 changed files with 40 additions and 16 deletions
|
@ -166,8 +166,6 @@ int FileIndexStore::RequestDirDetails(std::string uid, std::string path, DirDeta
|
|||
|
||||
int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) const
|
||||
{
|
||||
lockData();
|
||||
|
||||
#ifdef FIS_DEBUG
|
||||
std::cerr << "FileIndexStore::RequestDirDetails() ref=" << ref << " flags: " << flags << std::endl;
|
||||
#endif
|
||||
|
@ -175,6 +173,14 @@ int FileIndexStore::RequestDirDetails(void *ref, DirDetails &details, uint32_t f
|
|||
bool found = true;
|
||||
std::map<RsPeerId, FileIndex *>::const_iterator pit;
|
||||
|
||||
lockData();
|
||||
|
||||
if(ref != NULL && !FileIndex::isValid(ref))
|
||||
{
|
||||
unlockData() ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
/* so cast *ref to a DirEntry */
|
||||
FileEntry *file = (FileEntry *) ref;
|
||||
DirEntry *dir = dynamic_cast<DirEntry *>(file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue