[Redirector] Maybe fix panic

This commit is contained in:
Connection Refused
2021-10-14 18:47:42 +08:00
parent b10c1d287e
commit 06f215cedf
2 changed files with 8 additions and 1 deletions

View File

@@ -264,6 +264,11 @@ SocksHelper::UDP::~UDP()
this->udpSocket = INVALID_SOCKET;
}
if (this->tcpThread.joinable())
{
this->tcpThread.join();
}
}
bool SocksHelper::UDP::Associate()
@@ -345,7 +350,8 @@ bool SocksHelper::UDP::CreateUDP()
}
}
thread(&SocksHelper::UDP::Run, this).detach();
this->tcpThread = thread(&SocksHelper::UDP::Run, this);
this->tcpThread.detach();
return true;
}

View File

@@ -42,6 +42,7 @@ namespace SocksHelper
void Run();
SOCKADDR_IN6 address = { 0 };
thread tcpThread;
} *PUDP;
};