Added delete of TorControl in destructor of TorManagerPrivate

This commit is contained in:
thunder2 2021-12-29 16:14:48 +01:00
parent 8d3046d157
commit 97f7e0f936

View File

@ -71,6 +71,7 @@ public:
HiddenService *hiddenService ; HiddenService *hiddenService ;
explicit TorManagerPrivate(TorManager *parent = 0); explicit TorManagerPrivate(TorManager *parent = 0);
virtual ~TorManagerPrivate();
std::string torExecutablePath() const; std::string torExecutablePath() const;
bool createDataDir(const std::string &path); bool createDataDir(const std::string &path);
@ -104,6 +105,11 @@ TorManagerPrivate::TorManagerPrivate(TorManager *parent)
control->set_statusChanged_callback([this](int new_status,int /*old_status*/) { controlStatusChanged(new_status); }); control->set_statusChanged_callback([this](int new_status,int /*old_status*/) { controlStatusChanged(new_status); });
} }
TorManagerPrivate::~TorManagerPrivate()
{
delete(control);
}
TorManager *TorManager::instance() TorManager *TorManager::instance()
{ {
static TorManager *p = 0; static TorManager *p = 0;