mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
[Redirector] Maybe fix panic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ namespace SocksHelper
|
||||
void Run();
|
||||
|
||||
SOCKADDR_IN6 address = { 0 };
|
||||
thread tcpThread;
|
||||
} *PUDP;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user