mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 00:25:16 -04:00
* Fixed up various memory leaks (mainly serialiser cleanup).
* Added pthread_detach() to allow proper thread cleanup (affected ony Linux!) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@460 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e3df41b1da
commit
d69c2f72f1
9 changed files with 36 additions and 8 deletions
|
@ -217,6 +217,7 @@ void stunPeer(std::string id, struct sockaddr_in peeraddr)
|
|||
|
||||
void *data = (void *) pub;
|
||||
pthread_create(&tid, 0, &doStunPeer, data);
|
||||
pthread_detach(tid);
|
||||
|
||||
return;
|
||||
|
||||
|
@ -361,6 +362,7 @@ int main(int argc, char **argv)
|
|||
|
||||
#endif
|
||||
|
||||
srand(time(NULL)); /* randomise! */
|
||||
|
||||
if (!setOwnId)
|
||||
{
|
||||
|
|
|
@ -179,6 +179,7 @@ bool OpenDHTMgr::publishDHT(std::string key, std::string value, uint32_t ttl)
|
|||
|
||||
void *data = (void *) pub;
|
||||
pthread_create(&tid, 0, &doDhtPublish, data);
|
||||
pthread_detach(tid); /* so memory is reclaimed in linux */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -195,6 +196,7 @@ bool OpenDHTMgr::searchDHT(std::string key)
|
|||
|
||||
void *data = (void *) dht;
|
||||
pthread_create(&tid, 0, &doDhtSearch, data);
|
||||
pthread_detach(tid); /* so memory is reclaimed in linux */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue