mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-22 15:59:54 -05:00
Possibly got rid of this core dump in file uploads. It seems it came from unlocked destroying of dataplex->mServers when they came out of time, while the gui still asked for info about them.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1030 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9602f07760
commit
98911955d5
@ -443,6 +443,21 @@ bool ftDataMultiplex::locked_handleServerRequest(ftFileProvider *provider,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ftDataMultiplex::deleteServers(const std::list<std::string>& serv)
|
||||||
|
{
|
||||||
|
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||||
|
|
||||||
|
for(std::list<std::string>::const_iterator it=serv.begin();it != serv.end(); it++)
|
||||||
|
{
|
||||||
|
std::map<std::string,ftFileProvider *>::iterator sit = mServers.find(*it);
|
||||||
|
|
||||||
|
if(mServers.end() != sit)
|
||||||
|
{
|
||||||
|
delete sit->second;
|
||||||
|
mServers.erase(sit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ftDataMultiplex::handleSearchRequest(std::string peerId,
|
bool ftDataMultiplex::handleSearchRequest(std::string peerId,
|
||||||
std::string hash, uint64_t size,
|
std::string hash, uint64_t size,
|
||||||
|
@ -96,6 +96,9 @@ bool FileUploads(std::list<std::string> &hashs);
|
|||||||
bool FileDownloads(std::list<std::string> &hashs);
|
bool FileDownloads(std::list<std::string> &hashs);
|
||||||
bool FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info);
|
bool FileDetails(std::string hash, uint32_t hintsflag, FileInfo &info);
|
||||||
|
|
||||||
|
void deleteServers(const std::list<std::string>& serv_hash) ;
|
||||||
|
|
||||||
|
|
||||||
/*************** SEND INTERFACE (calls ftDataSend) *******************/
|
/*************** SEND INTERFACE (calls ftDataSend) *******************/
|
||||||
|
|
||||||
/* Client Send */
|
/* Client Send */
|
||||||
|
@ -203,18 +203,9 @@ void ftServer::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<std::string>::iterator it;
|
if(!toDels.empty())
|
||||||
for (it = toDels.begin();it != toDels.end(); it++)
|
mFtDataplex->deleteServers(toDels) ;
|
||||||
{
|
|
||||||
sit = mFtDataplex->mServers.find(*it);
|
|
||||||
|
|
||||||
if(mFtDataplex->mServers.end() != sit)
|
|
||||||
{
|
|
||||||
delete sit->second;
|
|
||||||
mFtDataplex->mServers.erase(sit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user