mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
Added shutdown of tor management threads
This commit is contained in:
parent
72eb21bbca
commit
460dbdcdc8
3 changed files with 23 additions and 2 deletions
|
@ -53,6 +53,8 @@
|
|||
|
||||
using namespace Tor;
|
||||
|
||||
static TorManager *rsTor = nullptr;
|
||||
|
||||
namespace Tor
|
||||
{
|
||||
|
||||
|
@ -840,6 +842,17 @@ bool RsTor::start()
|
|||
return instance()->startTorManager();
|
||||
}
|
||||
|
||||
void RsTor::stop()
|
||||
{
|
||||
if (rsTor) {
|
||||
if (rsTor->isRunning()) {
|
||||
rsTor->fullstop();
|
||||
}
|
||||
delete(rsTor);
|
||||
rsTor= nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void RsTor::setTorDataDirectory(const std::string& dir)
|
||||
{
|
||||
instance()->setTorDataDirectory(dir);
|
||||
|
@ -855,8 +868,6 @@ TorManager *RsTor::instance()
|
|||
assert(getpid() == syscall(SYS_gettid));// make sure we're not in a thread
|
||||
#endif
|
||||
|
||||
static TorManager *rsTor = nullptr;
|
||||
|
||||
if(rsTor == nullptr)
|
||||
rsTor = new TorManager;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue