[Download] Fix memory leaks

This commit is contained in:
momo5502 2017-06-02 12:26:08 +02:00
parent 4ce594609f
commit 8785dfe316
3 changed files with 6 additions and 10 deletions

View File

@ -109,7 +109,5 @@ namespace Components
{
Discovery::Thread.join();
}
Discovery::Thread = std::thread();
}
}

View File

@ -828,12 +828,6 @@ namespace Components
Download::~Download()
{
Download::Terminate = true;
if (Download::ServerThread.joinable())
{
Download::ServerThread.join();
}
if (Dedicated::IsEnabled())
{
mg_mgr_free(&Download::Mgr);
@ -842,6 +836,12 @@ namespace Components
void Download::preDestroy()
{
Download::Terminate = true;
if (Download::ServerThread.joinable())
{
Download::ServerThread.join();
}
if (!Dedicated::IsEnabled())
{
Download::CLDownload.clear();

View File

@ -129,8 +129,6 @@ namespace Components
Logger::Print("Pipe thread terminated.\n");
}
this->thread = std::thread();
}
void Pipe::setName(std::string name)