Tiny threads fixes & a little bit of safety
This commit is contained in:
parent
9a53709db0
commit
dde857dfb4
18 changed files with 85 additions and 154 deletions
|
|
@ -42,7 +42,7 @@ NetworkClient::NetworkClient(std::vector<RGBController *>& control) : controller
|
|||
|
||||
NetworkClient::~NetworkClient()
|
||||
{
|
||||
delete ConnectionThread;
|
||||
StopClient();
|
||||
}
|
||||
|
||||
void NetworkClient::ClientInfoChanged()
|
||||
|
|
@ -145,8 +145,17 @@ void NetworkClient::StopClient()
|
|||
}
|
||||
|
||||
if(ListenThread)
|
||||
{
|
||||
ListenThread->join();
|
||||
ConnectionThread->join();
|
||||
delete ListenThread;
|
||||
ListenThread = nullptr;
|
||||
}
|
||||
if(ConnectionThread)
|
||||
{
|
||||
ConnectionThread->join();
|
||||
delete ConnectionThread;
|
||||
ConnectionThread = nullptr;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Client info has changed, call the callbacks |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue