[Download] Fix memory leaks
This commit is contained in:
parent
4ce594609f
commit
8785dfe316
@ -109,7 +109,5 @@ namespace Components
|
|||||||
{
|
{
|
||||||
Discovery::Thread.join();
|
Discovery::Thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
Discovery::Thread = std::thread();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -828,12 +828,6 @@ namespace Components
|
|||||||
|
|
||||||
Download::~Download()
|
Download::~Download()
|
||||||
{
|
{
|
||||||
Download::Terminate = true;
|
|
||||||
if (Download::ServerThread.joinable())
|
|
||||||
{
|
|
||||||
Download::ServerThread.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Dedicated::IsEnabled())
|
if (Dedicated::IsEnabled())
|
||||||
{
|
{
|
||||||
mg_mgr_free(&Download::Mgr);
|
mg_mgr_free(&Download::Mgr);
|
||||||
@ -842,6 +836,12 @@ namespace Components
|
|||||||
|
|
||||||
void Download::preDestroy()
|
void Download::preDestroy()
|
||||||
{
|
{
|
||||||
|
Download::Terminate = true;
|
||||||
|
if (Download::ServerThread.joinable())
|
||||||
|
{
|
||||||
|
Download::ServerThread.join();
|
||||||
|
}
|
||||||
|
|
||||||
if (!Dedicated::IsEnabled())
|
if (!Dedicated::IsEnabled())
|
||||||
{
|
{
|
||||||
Download::CLDownload.clear();
|
Download::CLDownload.clear();
|
||||||
|
@ -129,8 +129,6 @@ namespace Components
|
|||||||
|
|
||||||
Logger::Print("Pipe thread terminated.\n");
|
Logger::Print("Pipe thread terminated.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
this->thread = std::thread();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pipe::setName(std::string name)
|
void Pipe::setName(std::string name)
|
||||||
|
Loading…
Reference in New Issue
Block a user