mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
moved rsGlobalShutDown from MainWindow::doQuit to main
rsGlobalShutDown now cleans the threads and some memory on exit git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3028 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b80aef1228
commit
334c9b61d3
13 changed files with 61 additions and 16 deletions
|
@ -207,7 +207,7 @@ void ftController::run()
|
|||
/* check the queues */
|
||||
uint32_t cnt = 0 ;
|
||||
|
||||
while(1)
|
||||
while(m_bRun)
|
||||
{
|
||||
#ifdef WIN32
|
||||
Sleep(1000);
|
||||
|
|
|
@ -49,7 +49,7 @@ void ftExtraList::run()
|
|||
time_t cleanup = 0;
|
||||
time_t now = 0;
|
||||
|
||||
while (1)
|
||||
while (m_bRun)
|
||||
{
|
||||
#ifdef DEBUG_ELIST
|
||||
//std::cerr << "ftExtraList::run() Iteration";
|
||||
|
|
|
@ -191,6 +191,37 @@ void ftServer::StartupThreads()
|
|||
start();
|
||||
}
|
||||
|
||||
void ftServer::StopThreads()
|
||||
{
|
||||
/* stop own thread */
|
||||
join();
|
||||
|
||||
/* stop Dataplex */
|
||||
mFtDataplex->join();
|
||||
|
||||
/* stop Controller thread */
|
||||
mFtController->join();
|
||||
|
||||
/* stop Monitor Thread */
|
||||
mFiMon->join();
|
||||
|
||||
/* self contained threads */
|
||||
/* stop ExtraList Thread */
|
||||
mFtExtra->join();
|
||||
|
||||
delete (mFtDataplex);
|
||||
mFtDataplex = NULL;
|
||||
|
||||
delete (mFtController);
|
||||
mFtController = NULL;
|
||||
|
||||
delete (mFiMon);
|
||||
mFiMon = NULL;
|
||||
|
||||
delete (mFtExtra);
|
||||
mFtExtra = NULL;
|
||||
}
|
||||
|
||||
CacheStrapper *ftServer::getCacheStrapper()
|
||||
{
|
||||
return mCacheStrapper;
|
||||
|
@ -203,7 +234,7 @@ CacheTransfer *ftServer::getCacheTransfer()
|
|||
|
||||
void ftServer::run()
|
||||
{
|
||||
while(1)
|
||||
while(m_bRun)
|
||||
{
|
||||
mFtDataplex->deleteUnusedServers() ;
|
||||
#ifdef WIN32
|
||||
|
|
|
@ -98,6 +98,7 @@ void SetupFtServer(NotifyBase *cb);
|
|||
void connectToTurtleRouter(p3turtle *p) ;
|
||||
|
||||
void StartupThreads();
|
||||
void StopThreads();
|
||||
|
||||
/* own thread */
|
||||
virtual void run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue